]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-124130: Notes on empty string corner case of category `\B` (#124133)
authorY5 <124019959+y5c4l3@users.noreply.github.com>
Mon, 23 Sep 2024 06:58:14 +0000 (06:58 +0000)
committerGitHub <noreply@github.com>
Mon, 23 Sep 2024 06:58:14 +0000 (08:58 +0200)
Signed-off-by: y5c4l3 <y5c4l3@proton.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Doc/library/re.rst

index efb2722f18038fd9c08801b90212556c8eae94db..9db6f1da3be4db99ac313d84a872d69c3d57cf9d 100644 (file)
@@ -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``