Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d3e79d7

Browse files
y5c4l3picnixz
andauthored
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]>
1 parent 2e8c769 commit d3e79d7

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)