From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 23 Sep 2024 22:50:54 +0000 (+0200) Subject: [3.13] gh-124130: Notes on empty string corner case of category `\B` (GH-124133)... X-Git-Tag: v3.13.0rc3~123 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5760330c7a0e6e44b5923999bd5818e21b5539aa;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-124130: Notes on empty string corner case of category `\B` (GH-124133) (#124328) gh-124130: Notes on empty string corner case of category `\B` (GH-124133) (cherry picked from commit d3e79d75d164c338a64fd66edb26e69c501cee58) Signed-off-by: y5c4l3 Co-authored-by: Y5 <124019959+y5c4l3@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- diff --git a/Doc/library/re.rst b/Doc/library/re.rst index efb2722f1803..9db6f1da3be4 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``