Skip to content

Commit 0313791

Browse files
committed
Notes on empty string corner case of category \B
Signed-off-by: y5c4l3 <[email protected]>
1 parent 342e654 commit 0313791

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+
However, ``\B`` does not match an empty string, which acts a little bit
578+
different compared to other implementations. This behavior is currently
579+
kept for compatibility considerations.
580+
575581
.. index:: single: \d; in regular expressions
576582

577583
``\d``

0 commit comments

Comments
 (0)