Documentation inconsistency in re
Christopher A. Craig wrote:
From the Library Reference (2.2.1):
\b Matches the empty string, but only at the beginning or end of a word. A word is defined as a sequence of alphanumeric characters, so the end of a word is indicated by whitespace or a non-alphanumeric character. Inside a character range, \b represents the backspace character, for compatibility with Python's string literals.
as you suspected, the documentation is flawed: \b is defined in terms of \w and \W. </F>
Christopher> So the implementation appears to define a word as a Christopher> sequence of alphanumeric characters or underscores, which Christopher> means either the documentation, or the library is wrong. Documentation has been fixed. Skip
participants (3)
-
Fredrik Lundh
-
list-python@ccraig.org
-
Skip Montanaro