| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
(cherry picked from commit 6b45076bd62407103433daea8acf085a99e6cb7e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
| |
version (GH-91580). (GH-91661) (GH-91837)
(cherry picked from commit 1c2fcebf3c5e2ab41d376bb481834445617c8f3c)
(cherry picked from commit 1748816e80b23744667e239b49b477c0e283d201)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-91702) (GH-91831) (GH-91836)
In expression (?(group)...) an appropriate re.error is now
raised if the group number refers to not defined group.
Previously it raised RuntimeError: invalid SRE code.
(cherry picked from commit 48ec61a89a959071206549819448405c2cea61b0)
(cherry picked from commit 080781cd49b13da4a73db87b6f5e0c7aeec83e92)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
(GH-91665) (GH-91830) (GH-91834)
re.error is now raised instead of TypeError.
(cherry picked from commit 6ccfa31421393910b52936e0447625db06f2a655)
(cherry picked from commit 9c18d783c38fca57a63b61aa778d8a8d18945d95)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 74070085da5322ac83c954f101f2caa150655be2)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
| |
A warning about inline flags not at the start of the regular
expression now contains the position of the flag.
(cherry picked from commit 4142961b9f5ad3bf93976a6a7162f8049e354018)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-36929: Modify io/re tests to allow for missing mod name
For a vanishingly small number of internal types, CPython sets the
tp_name slot to mod_name.type_name, either in the PyTypeObject or the
PyType_Spec. There are a few minor places where this surfaces:
* Custom repr functions for those types (some of which ignore the
tp_name in favor of using a string literal, such as _io.TextIOWrapper)
* Pickling error messages
The test suite only tests the former. This commit modifies the test
suite to allow Python implementations to omit the module prefix.
https://bugs.python.org/issue36929
|
|
|
|
|
|
|
|
|
| |
Use locale.getpreferredencoding() rather than locale.getlocale() to
get the locale encoding. With some locales, locale.getlocale()
returns the wrong encoding.
For example, on Fedora 29, locale.getlocale() returns ISO-8859-1
encoding for the "en_IN" locale, whereas
locale.getpreferredencoding() reports the correct encoding: UTF-8.
|
|
|
|
|
|
| |
Need to reset capturing groups between two SRE(match) callings in loops, this fixes wrong capturing groups in rare cases.
Also add a missing index in re.rst.
|
|
|
| |
Co-authored-by: Jonathan Eunice <jonathan.eunice@gmail.com>
|
|
|
|
| |
re.sub(). (#4846)
|
| |
|
|
|
|
|
|
| |
(#4471)
Also fixed searching patterns that could match an empty string.
|
|
|
|
| |
in regular expressions.
|
|
|
|
| |
flags for RE. (#3885)
|
| |
|
|
|
| |
Previously any exception was replaced with a KeyError exception.
|
|
|
|
| |
Running our unit tests with `-bb` enabled triggered this failure.
|
|
|
|
|
|
| |
Warnings emitted when compile a regular expression now always point
to the line in the user code. Previously they could point into inners
of the re module if emitted from inside of groups or conditionals.
|
|
|
|
|
| |
`re.compile(..., re.DEBUG)` now displays the compiled bytecode in
human readable form.
|
|
|
|
| |
This increased the performance of matching some patterns up to 25 times.
|
|
|
|
|
|
|
|
| |
modifiers. (#1490)
Now allowed several subsequential inline modifiers at the start of the
pattern (e.g. '(?i)(?s)...'). In verbose mode whitespaces and comments
now are allowed before and between inline modifiers (e.g.
'(?x) (?i) (?s)...').
|
|
|
|
| |
of regular expressions.
|
|
|
|
| |
_sre.unicode_tolower(). (#1468)
|
|
|
|
|
|
| |
Compiled regular expression objects with the re.LOCALE flag no longer
depend on the locale at compile time. Only the locale at matching
time affects the result of matching.
|
|
|
|
| |
(#1000)
|
| |
|
|
|
| |
Make also minor PEP8 coding style fixes on modified imports.
|
|
|
| |
This reverts commit ace5c0fdd9b962e6e886c29dbcea72c53f051dc4.
|
|
|
| |
This reverts commit 43f5df5bfaea5a07c913d12cb92f78f997feb371.
|
| |
|
|
|
|
|
|
|
| |
``local.getlocale(locale.LC_CTYPE)`` and
``locale.getpreferredencoding(False)`` may give different answers
in some cases (such as the ``en_IN`` locale).
``re.LOCALE`` uses the latter, so update the test case to match.
|
|\
| |
| |
| | |
the match object. Based on patch by WGH.
|
| |\
| | |
| | |
| | | |
the match object. Based on patch by WGH.
|
| | |
| | |
| | |
| | | |
the match object. Based on patch by WGH.
|
| | |
| | |
| | |
| | | |
again. But they still are deprecated and will be disabled in 3.7.
|
| | | |
|
|/ /
| |
| |
| |
| |
| | |
groupindex must a dictionary and indexgroup must be a tuple.
Previously, indexgroup was a list. Use a tuple to reduce the memory usage.
|
| |
| |
| |
| | |
A pattern is equal to itself.
|
| |
| |
| |
| |
| |
| |
| | |
Issue #28727: Regular expression patterns, _sre.SRE_Pattern objects created by
re.compile(), become comparable (only x==y and x!=y operators). This change
should fix the issue #18383: don't duplicate warning filters when the warnings
module is reloaded (thing usually only done in unit tests).
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
reference in replacement template even if the pattern is not found in
the string. Error message for invalid group reference now includes the
group index and the position of the reference.
Based on patch by SilentGhost.
|
|\ \
| |/
| |
| | |
arguments.
|
| |
| |
| |
| | |
arguments.
|
| | |
|
| |
| |
| |
| |
| | |
regular expression now contains a (truncated) regex pattern.
Patch by Tim Graham.
|
| | |
|
| |
| |
| |
| |
| | |
regular expression. Deprecation warning is emitted if uses them in the
middle of the regular expression.
|