Skip to content

Commit

Permalink
Notes on empty string corner case of category \B
Browse files Browse the repository at this point in the history
Signed-off-by: y5c4l3 <y5c4l3@proton.me>
  • Loading branch information
y5c4l3 committed Sep 21, 2024
1 parent 342e654 commit 0313791
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Doc/library/re.rst
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,12 @@ character ``'$'``.
Word boundaries are determined by the current locale
if the :py:const:`~re.LOCALE` flag is used.

.. note::

However, ``\B`` does not match an empty string, which acts a little bit
different compared to other implementations. This behavior is currently
kept for compatibility considerations.

.. index:: single: \d; in regular expressions

``\d``
Expand Down

0 comments on commit 0313791

Please sign in to comment.