summaryrefslogtreecommitdiffstats
path: root/Doc/library/re.rst
diff options
context:
space:
mode:
authorY5 <124019959+y5c4l3@users.noreply.github.com>2024-09-23 06:58:14 (GMT)
committerGitHub <noreply@github.com>2024-09-23 06:58:14 (GMT)
commitd3e79d75d164c338a64fd66edb26e69c501cee58 (patch)
treea656cbb8021897baf9e2f1080247c235f54259cb /Doc/library/re.rst
parent2e8c769481d5729d86be8c6cff5881c4c5fbb8d2 (diff)
downloadcpython-d3e79d75d164c338a64fd66edb26e69c501cee58.zip
cpython-d3e79d75d164c338a64fd66edb26e69c501cee58.tar.gz
cpython-d3e79d75d164c338a64fd66edb26e69c501cee58.tar.bz2
gh-124130: Notes on empty string corner case of category `\B` (#124133)
Signed-off-by: y5c4l3 <y5c4l3@proton.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Diffstat (limited to 'Doc/library/re.rst')
-rw-r--r--Doc/library/re.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index efb2722..9db6f1d 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``