mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-133306: Support \z as a synonym for \Z in regular expressions (GH-133314)
\Z was an error inherited from PCRE 0.95. It was fixed in PCRE 2.0. In other engines, \Z means not “anchor at string end”, but “anchor before optional newline at string end”. \z means “anchor at string end” in most RE engines.
This commit is contained in:
parent
fe44fc4f43
commit
ac56f8cc8d
8 changed files with 31 additions and 10 deletions
|
@ -531,7 +531,7 @@ xyzabc
|
|||
(r'a[ ]*?\ (\d+).*', 'a 10', SUCCEED, 'found', 'a 10'),
|
||||
(r'a[ ]*?\ (\d+).*', 'a 10', SUCCEED, 'found', 'a 10'),
|
||||
# bug 127259: \Z shouldn't depend on multiline mode
|
||||
(r'(?ms).*?x\s*\Z(.*)','xx\nx\n', SUCCEED, 'g1', ''),
|
||||
(r'(?ms).*?x\s*\z(.*)','xx\nx\n', SUCCEED, 'g1', ''),
|
||||
# bug 128899: uppercase literals under the ignorecase flag
|
||||
(r'(?i)M+', 'MMM', SUCCEED, 'found', 'MMM'),
|
||||
(r'(?i)m+', 'MMM', SUCCEED, 'found', 'MMM'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue