NOTICE: this is using a non-greedy (or minimal) regex @type name: str @param name: the name used to tag the expression @type greedy: bool @param greedy: Whether the regex is greedy or not @return: Returns a named string regex (only non-whitespace characters allowed)
(name, greedy=False)
| 43 | |
| 44 | |
| 45 | def _ns(name, greedy=False): |
| 46 | ''' |
| 47 | NOTICE: this is using a non-greedy (or minimal) regex |
| 48 | |
| 49 | @type name: str |
| 50 | @param name: the name used to tag the expression |
| 51 | @type greedy: bool |
| 52 | @param greedy: Whether the regex is greedy or not |
| 53 | |
| 54 | @return: Returns a named string regex (only non-whitespace characters allowed) |
| 55 | ''' |
| 56 | return '(?P<%s>\S+%s)' % (name, '' if greedy else '?') |
| 57 | |
| 58 | |
| 59 | def obtainPxPy(m): |
no outgoing calls
no test coverage detected