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:
Serhiy Storchaka 2025-05-03 10:54:33 +03:00 committed by GitHub
parent fe44fc4f43
commit ac56f8cc8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 31 additions and 10 deletions

View file

@ -61,7 +61,7 @@ below. If the ordinary character is not on the list, then the
resulting RE will match the second character.
\number Matches the contents of the group of the same number.
\A Matches only at the start of the string.
\Z Matches only at the end of the string.
\z Matches only at the end of the string.
\b Matches the empty string, but only at the start or end of a word.
\B Matches the empty string, but not at the start or end of a word.
\d Matches any decimal digit; equivalent to the set [0-9] in