8000 [3.13] gh-124130: Notes on empty string corner case of category `\B` … · python/cpython@5760330 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5760330

Browse files
miss-islingtony5c4l3picnixz
authored
[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 d3e79d7) Signed-off-by: y5c4l3 <y5c4l3@proton.me> Co-authored-by: Y5 <124019959+y5c4l3@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent a052faf commit 5760330

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Doc/library/re.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,12 @@ character ``'$'``.
572572
Word boundaries are determined by the current locale
573573
if the :py:const:`~re.LOCALE` flag is used.
574574

575+
.. note::
576+
577+
Note that ``\B`` does not match an empty string, which differs from
578+
RE implementations in other programming languages such as Perl.
579+
This behavior is kept for compatibility reasons.
580+
575581
.. index:: single: \d; in regular expressions
576582

577583
``\d``

0 commit comments

Comments
 (0)
0