[Python-bugs-list] "Andrew M. Kuchling": Re: Module re bug. \b fails (PR#230)

guido@python.org guido@python.org
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" <akuchlin@mems-exchange.org>
To:      Guido van Rossum <guido@python.org>
cc:      fdrake@acm.org, ken@basistech.com
Subject: Re: Module re bug. \b fails (PR#230)

Guido van Rossum writes:
>Ken reported:
> > \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