Re: startswith() and endswith() for re's would be more intuitive
- From: Bruno Desthuilliers <onurb@xxxxxxxxxxx>
- Date: Thu, 28 Sep 2006 16:29:42 +0200
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)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb@xxxxxxxxxxx'.split('@')])"
.
- Follow-Ups:
- Re: startswith() and endswith() for re's would be more intuitive
- From: John Salerno
- Re: startswith() and endswith() for re's would be more intuitive
- References:
- startswith() and endswith() for re's would be more intuitive
- From: metaperl
- startswith() and endswith() for re's would be more intuitive
- Prev by Date: best way to get data into a new instance?
- Next by Date: Re: remove the last character or the newline character?
- Previous by thread: startswith() and endswith() for re's would be more intuitive
- Next by thread: Re: startswith() and endswith() for re's would be more intuitive
- Index(es):
Relevant Pages
|