[issue10713] re module doesn't describe string boundaries for \b
New submission from Ralph Corderoy
Éric Araujo
Changes by Ezio Melotti
Ralph Corderoy
Changes by Ron Ridley
Martin Pool
Note, 366 above confirms it's never true for an empty string. The documentation states that \B "is just the opposite of \b" yet re.match(r'\b', '') returns None and so does \B so \B isn't the opposite of \b in all cases.
This is also a bit strange if you follow the Perl line of reasoning of imagining there are non-word characters outside the string. And, indeed, in Perl,
"" =~ /\B/
is true.
So this patch adds some tests for \b behaviour and some docs. I think possible \B should actually change, but that would be a bigger (perhaps impossible?) change.
----------
keywords: +patch
nosy: +poolie
Added file: http://bugs.python.org/file22991/20110822-1604-re-docs.diff
_______________________________________
Python tracker
Ezio Melotti
Éric Araujo
Roundup Robot
Ezio Melotti
participants (6)
-
Ezio Melotti
-
Martin Pool
-
Ralph Corderoy
-
Ron Ridley
-
Roundup Robot
-
Éric Araujo