Skip to content

Commit f06d79a

Browse files
Merge pull request #875 from ossf/better-python-explanation
Improve explanation of Python \z situation
2 parents df43b7e + 8268eb9 commit f06d79a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/Correctly-Using-Regular-Expressions-Rationale.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,14 @@ be nearly universal:
507507
to add \A and \z to ECMAScript/JavaScript, and it advanced to stage 2,
508508
but it seems to be stuck there. We intend to see if we can help it advance.
509509
* Python: Python supports \A, but it uses the unique \Z instead of the
510-
\z used everywhere else.
511-
We'll ask to see if it can be advanced.
510+
\z used everywhere else for end-of-string.
511+
We'll ask to see if \z could be supported in addition to \Z for end-of-string.
512+
We'll probably start with a minor git request (as this is a really
513+
small change), otherwise we'll create a PEP, depending on the desires
514+
of the Python community.
515+
In current versions of Python3 a \z in a regex raises an exception, so
516+
adding \z for end-of-string would be a backwards-compatible addition.
517+
See [CPython issue 133306](https://github.com/python/cpython/issues/133306).
512518

513519
## Authors and contributors
514520

0 commit comments

Comments
 (0)