python-regex
Port variant py37
Summary Alternative regular expression module (PY37)
Package version 2020.11.13
Homepage https://bitbucket.org/mrabarnett/mrab-regex
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants py38
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 19 NOV 2020, 01:05:06 UTC
Port created 09 APR 2020, 23:39:09 UTC
Subpackage Descriptions
single Introduction ------------ This regex implementation is backwards-compatible with the standard 're' module, but offers additional functionality. Note ---- The re module's behaviour with zero-width matches changed in Python 3.7, and this module will follow that behaviour when compiled for Python 3.7. Old vs new behaviour -------------------- In order to be compatible with the re module, this module has 2 behaviours: * **Version 0** behaviour (old behaviour, compatible with the re module): Please note that the re module's behaviour may change over time, and I'll endeavour to match that behaviour in version 0. * Indicated by the VERSION0 or V0 flag, or ``(?V0)`` in the pattern. * Zero-width matches are not handled correctly in the re module before Python 3.7. The behaviour in those earlier versions is: * ``.split`` won't split a string at a zero-width match. * ``.sub`` will advance by one character after a zero-width match. * Inline flags apply to the entire pattern, and they can't be turned off. * Only simple sets are supported. * Case-insensitive matches in Unicode use simple case-folding by default. * **Version 1** behaviour (new behaviour, possibly different from the re module): * Indicated by the VERSION1 or V1 flag, or ``(?V1)`` in the pattern. * Zero-width matches are handled correctly. * Inline flags apply to the end of the group or pattern, and they can be turned off. * Nested sets and set operations are supported. * Case-insensitive matches in Unicode use full case-folding by default. If no version is specified, the regex module will default to ``regex.DEFAULT_VERSION``. Case-insensitive matches in Unicode ----------------------------------- The regex module supports both simple and full case-folding for case-insensitive matches in Unicode. Use of full case-folding can be turned on using the FULLCASE or F flag, or ``(?f)`` in the pattern. Please note that this flag affects how the IGNORECASE flag works; the FULLCASE flag itself does not turn on case-insensitive matching. In the version 0 behaviour, the flag is off by default. In the version 1 behaviour, the flag is on by default. Nested sets and set operations ------------------------------ It's not possible to support both simple sets, as used in the re module, and nested sets at the same time because of a difference in the meaning of an unescaped ``"["`` in a set. For example, the pattern ``[[a-z]--[aeiou]]`` is treated in the version 0 behaviour (simple sets, compatible with the re module) as: * Set containing "[" and the letters "a" to "z" * Literal "--" * Set containing letters "a", "e", "i", "o", "u" * Literal "]" but in the version 1 behaviour (nested sets, enhanced behaviour) as: * Set which is: * Set containing the letters "a" to "z" * but excluding: * Set containing the letters "a", "e", "i", "o", "u" Version 0 behaviour: only simple sets are supported. Version 1 behaviour: nested sets and set operations are supported. Flags
Configuration Switches (platform-specific settings discarded)
PY37 ON Build using Python 3.7 PY38 OFF Build using Python 3.8
Package Dependencies by Type
Build and Runtime python37:single:standard
python-setuptools:single:py37
Download groups
main mirror://PYPI/r/regex
Distribution File Information
83d6b356e116ca119db8e7c6fc2983289d87b27b3fac238cfe5dca529d884562 694595 regex-2020.11.13.tar.gz
Ports that require python-regex:py37
python-black:py37 Uncompromising code formatter (PY37)