Bruno Desthuilliers wrote:
> metaperl wrote:
> > I just finished answering a question in #python because someone tried
> > to match using ... well.. match()
> > but did not realize that match() is actually startswith() for regexps.
>
> Yet someone else that failed to read the Fine Manual(tm).
>
> > I suggest:
> > re.compile('blah').atstartof(string)
> > re.compile('blah').atendof(string)
>
> What's wrong with:
> re.search(r'^blah', somestring)
> re.search(r'blah$', somestring)

Nothing. There is also nothing wrong with

re.match('blah', somestring)

but it does read as well as

re.atstartof('blah', something)

and the counterpart for EOS is not there.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to