summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.6] bpo-30978: str.format_map() now passes key lookup exceptions through. ↵Serhiy Storchaka2017-08-031-1/+1
| | | | | | (GH-2790) (#2992) Previously any exception was replaced with a KeyError exception. (cherry picked from commit 5075416)
* [3.6] bpo-30605: Fix compiling binary regexs with BytesWarnings enabled. ↵Serhiy Storchaka2017-06-151-2/+14
| | | | | | (GH-2016) (#2214) Running our unit tests with `-bb` enabled triggered this failure.. (cherry picked from commit 171b9a354e816eebc6d4c3a8553303942e9c5025)
* [3.6] bpo-30375: Correct the stacklevel of regex compiling warnings. ↵Serhiy Storchaka2017-05-161-3/+14
| | | | | | | | | (GH-1595) (#1604) 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.. (cherry picked from commit c7ac7280c321b3c1679fe5f657a6be0f86adf173)
* [3.6] bpo-30298: Weaken the condition of deprecation warnings for inline ↵Serhiy Storchaka2017-05-101-14/+45
| | | | | | | | | modifiers. (GH-1490) (#1525) 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)...').. (cherry picked from commit 305ccbe27ea5ba82fd2d8c32ec739f980e524330)
* Revert "bpo-29571: Use correct locale encoding in test_re (#149)" (#554) (#555)Benjamin Peterson2017-03-081-1/+1
| | | This reverts commit ace5c0fdd9b962e6e886c29dbcea72c53f051dc4.
* [3.6] bpo-29571: Use correct locale encoding in test_re (#149) (#153)Nick Coghlan2017-02-191-1/+1
| | | | | | | ``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.
* Issue #29444: Fixed out-of-bounds buffer access in the group() method ofSerhiy Storchaka2017-02-041-0/+10
|\ | | | | | | the match object. Based on patch by WGH.
| * Issue #29444: Fixed out-of-bounds buffer access in the group() method ofSerhiy Storchaka2017-02-041-0/+10
| | | | | | | | the match object. Based on patch by WGH.
* | Issue #27030: Unknown escapes in re.sub() replacement template are allowedSerhiy Storchaka2016-12-061-1/+1
| | | | | | | | again. But they still are deprecated and will be disabled in 3.7.
* | Issue #28727: Optimize pattern_richcompare() for a==aVictor Stinner2016-11-221-0/+4
| | | | | | | | A pattern is equal to itself.
* | Implement rich comparison for _sre.SRE_PatternVictor Stinner2016-11-211-2/+45
| | | | | | | | | | | | | | 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).
* | Issue #28082: Add basic unit tests on re enumsVictor Stinner2016-11-141-0/+6
| |
* | Issue #25953: re.sub() now raises an error for invalid numerical groupSerhiy Storchaka2016-10-231-21/+22
| | | | | | | | | | | | | | 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.
* | Issue #11957: Restored re tests for passing count and maxsplit as positionalSerhiy Storchaka2016-09-251-0/+5
|\ \ | |/ | | | | arguments.
| * Issue #11957: Restored re tests for passing count and maxsplit as positionalSerhiy Storchaka2016-09-251-0/+5
| | | | | | | | arguments.
| * Backported tests for issue #28070.Serhiy Storchaka2016-09-101-0/+3
| |
* | Issue #22493: Warning message emitted by using inline flags in the middle ofSerhiy Storchaka2016-09-161-2/+15
| | | | | | | | | | regular expression now contains a (truncated) regex pattern. Patch by Tim Graham.
* | Issue 24454: Improve the usability of the re match object named group APIEric V. Smith2016-09-111-0/+44
| |
* | Issue #22493: Inline flags now should be used only at the start of theSerhiy Storchaka2016-09-111-0/+3
| | | | | | | | | | regular expression. Deprecation warning is emitted if uses them in the middle of the regular expression.
* | Issue #28070: Fixed parsing inline verbose flag in regular expressions.Serhiy Storchaka2016-09-101-0/+3
| |
* | Issue #433028: Added support of modifier spans in regular expressions.Serhiy Storchaka2016-09-091-4/+36
| |
* | #27364: fix "incorrect" uses of escape character in the stdlib.R David Murray2016-09-081-100/+100
| | | | | | | | | | | | | | And most of the tools. Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and Martin Panter.
* | Issue #27177: Match objects in the re module now support index-like objectsSerhiy Storchaka2016-06-181-7/+21
| | | | | | | | as group indices. Based on patches by Jeroen Demeyer and Xiang Zhang.
* | Issue #27030: Unknown escapes consisting of ``'\'`` and ASCII letter inSerhiy Storchaka2016-06-111-28/+13
|/ | | | regular expressions now are errors.
* Issue #24580: Symbolic group references to open group in re patterns now areSerhiy Storchaka2015-07-181-0/+2
| | | | explicitly forbidden as well as numeric group references.
* Issue #14260: The groupindex attribute of regular expression pattern objectSerhiy Storchaka2015-03-291-0/+8
| | | | now is non-modifiable mapping.
* Issue #22364: Improved some re error messages using regex for hints.Serhiy Storchaka2015-03-251-74/+179
|
* Issue #23622: Unknown escapes in regular expressions that consist of ``'\'``Serhiy Storchaka2015-03-241-13/+30
| | | | | and ASCII letter now raise a deprecation warning and will be forbidden in Python 3.6.
* Issues #814253, #9179: Group references and conditional group references nowSerhiy Storchaka2015-02-211-1/+41
| | | | work in lookbehind assertions in regular expressions.
* Issue #22818: Splitting on a pattern that could match an empty string nowSerhiy Storchaka2015-02-031-9/+30
| | | | | raises a warning. Patterns that can only match empty strings are now rejected.
* Issue #21032: Deprecated the use of re.LOCALE flag with str patterns orSerhiy Storchaka2014-12-011-16/+66
| | | | re.ASCII. It was newer worked.
* Issue #22838: All test_re tests now work with unittest test discovery.Serhiy Storchaka2014-12-011-83/+63
|\
| * Issue #22838: All test_re tests now work with unittest test discovery.Serhiy Storchaka2014-12-011-83/+63
| |
* | merge 3.4 (#9179)Benjamin Peterson2014-11-301-37/+1
|\ \ | |/
| * backout 9fcf4008b626 (#9179) for further considerationBenjamin Peterson2014-11-301-37/+1
| |
* | Minor code clean up and improvements in the re module.Serhiy Storchaka2014-11-111-2/+2
| |
* | Fixed AttributeError when the regular expression starts from illegal escape.Serhiy Storchaka2014-11-101-0/+14
| |
* | Issue #22578: Added attributes to the re.error class.Serhiy Storchaka2014-11-101-0/+36
| |
* | Issue #12728: Different Unicode characters having the same uppercase butSerhiy Storchaka2014-11-101-0/+51
|\ \ | |/ | | | | different lowercase are now matched in case-insensitive regular expressions.
| * Issue #12728: Different Unicode characters having the same uppercase butSerhiy Storchaka2014-11-101-0/+51
| | | | | | | | different lowercase are now matched in case-insensitive regular expressions.
* | Issue #22434: Constants in sre_constants are now named constants (enum-like).Serhiy Storchaka2014-11-091-16/+16
| |
* | Issues #814253, #9179: Group references and conditional group references nowSerhiy Storchaka2014-11-071-1/+37
|\ \ | |/ | | | | work in lookbehind assertions in regular expressions.
| * Issues #814253, #9179: Group references and conditional group references nowSerhiy Storchaka2014-11-071-1/+37
| | | | | | | | work in lookbehind assertions in regular expressions.
| * Issue #17381: Fixed handling of case-insensitive ranges in regular expressions.Serhiy Storchaka2014-10-311-0/+19
| |
* | Issue #17381: Fixed handling of case-insensitive ranges in regular expressions.Serhiy Storchaka2014-10-311-0/+19
| | | | | | | | Added new opcode RANGE_IGNORE.
* | Issue #22410: Module level functions in the re module now cache compiledSerhiy Storchaka2014-10-301-0/+37
|\ \ | |/ | | | | locale-dependent regular expressions taking into account the locale.
| * Issue #22410: Module level functions in the re module now cache compiledSerhiy Storchaka2014-10-301-0/+37
| | | | | | | | locale-dependent regular expressions taking into account the locale.
* | Issue #11957: Explicit parameter name when calling re.split() and re.sub()Victor Stinner2014-10-291-7/+7
| |
* | Issue 1519638: Now unmatched groups are replaced with empty strings in re.sub()Serhiy Storchaka2014-10-101-2/+8
| | | | | | | | and re.subn().
* | Issue #22437: Number of capturing groups in regular expression is no longerSerhiy Storchaka2014-09-291-2/+16
| | | | | | | | limited by 100.