cpython: bee52e5f8fb1 (original) (raw)
Mercurial > cpython
changeset 103591:bee52e5f8fb1
Issue #28070: Fixed parsing inline verbose flag in regular expressions. [#28070]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Sun, 11 Sep 2016 01:39:01 +0300 |
parents | 6f2644738876 |
children | 208e1ed48cd3 |
files | Lib/sre_parse.py Lib/test/test_re.py Misc/NEWS |
diffstat | 3 files changed, 6 insertions(+), 0 deletions(-)[+] [-] Lib/sre_parse.py 1 Lib/test/test_re.py 3 Misc/NEWS 2 |
line wrap: on
line diff
--- a/Lib/sre_parse.py +++ b/Lib/sre_parse.py @@ -847,6 +847,7 @@ def parse(str, flags=0, pattern=None): pattern = Pattern() pattern.flags = flags | SRE_FLAG_VERBOSE pattern.str = str
source.seek(0)[](#l1.7) p = _parse_sub(source, pattern, True, False)[](#l1.8)
p.pattern.flags = fix_flags(str, p.pattern.flags)
--- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -1276,6 +1276,9 @@ class ReTests(unittest.TestCase): q = p.match(upper_char) self.assertTrue(q)
self.assertTrue(re.match('(?ixu) ' + upper_char, lower_char))[](#l2.7)
self.assertTrue(re.match('(?ixu) ' + lower_char, upper_char))[](#l2.8)
+ def test_dollar_matches_twice(self): "$ matches the end of string, and just before the terminating \n" pattern = re.compile('$')
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -138,6 +138,8 @@ Core and Builtins Library ------- +- Issue #28070: Fixed parsing inline verbose flag in regular expressions. +