[Python-bugs-list] "Andrew M. Kuchling": Re: Module re bug. \b fails (PR#230)
Thu, 9 Mar 2000 13:11:13 -0500 (EST)
Sigh. I'm embarrassed.
------- Forwarded Message
Date: Thu, 09 Mar 2000 13:11:38 -0500
From: "Andrew M. Kuchling" <email@example.com>
To: Guido van Rossum <firstname.lastname@example.org>
cc: email@example.com, firstname.lastname@example.org
Subject: Re: Module re bug. \b fails (PR#230)
Guido van Rossum writes:
> > \b doesn't seem to work as advertised in the following expression:
> > re.match( "\bchar\b", " char " )
>It seems that matching for \b doesn't work properly. I certainly
>would have expected re.match(r"x\b", " x ") to match, but it returns
You want re.search(); remember, re.match() requires that the match
begin at the start of the string, so x\b will never match " x ".
A.M. Kuchling http://starship.python.net/crew/amk/
So as this only point among the rest remaineth sure and certain, namely, that
nothing is certain...
-- Pliny the Elder, the Natural History, tr. Philemon Holland
------- End of Forwarded Message