https://github.com/python/cpython/commit/d3e79d75d164c338a64fd66edb26e69c501cee58
commit: d3e79d75d164c338a64fd66edb26e69c501cee58
branch: main
author: Y5 <[email protected]>
committer: vstinner <[email protected]>
date: 2024-09-23T08:58:14+02:00
summary:

gh-124130: Notes on empty string corner case of category `\B` (#124133)

Signed-off-by: y5c4l3 <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>

files:
M Doc/library/re.rst

diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index efb2722f18038f..9db6f1da3be4db 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -572,6 +572,12 @@ character ``'$'``.
    Word boundaries are determined by the current locale
    if the :py:const:`~re.LOCALE` flag is used.
 
+   .. note::
+
+      Note that ``\B`` does not match an empty string, which differs from
+      RE implementations in other programming languages such as Perl.
+      This behavior is kept for compatibility reasons.
+
 .. index:: single: \d; in regular expressions
 
 ``\d``

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to