[Python-bugs-list] Module re bug. \b fails (PR#230)

fdrake@acm.org fdrake@acm.org
Thu, 9 Mar 2000 11:43:11 -0500 (EST)


Ken reported:
 > \b doesn't seem to work as advertised in the following expression:
 > re.match( "\bchar\b", "  char " )

guido@python.org writes:
 > This is because \b is interpreted as a string literal
 > escape for backspace, before the regular expression parser gets to see

  I thought about that, but it *still* doesn't work:

>>> import re
>>> print re.match("\bchar\b", "  char ")
None
>>> print re.match(r"\bchar\b", "  char ")
None

  So not only is there a bug in the bug report, but somewhere in pcre
(or the Python binding) as well.


  -Fred

--
Fred L. Drake, Jr.	  <fdrake at acm.org>
Corporation for National Research Initiatives