Re: startswith() and endswith() for re's would be more intuitive
- From: John Salerno <johnjsal@xxxxxxxxxxxxxxx>
- Date: Thu, 28 Sep 2006 14:41:32 GMT
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)
I think, since he even said himself that "match() is actually startswith() for regexps", that he isn't complaining about the lack of this feature, just that he wants a name change. Otherwise I'm not sure what he wants.
.
- References:
- startswith() and endswith() for re's would be more intuitive
- From: metaperl
- Re: startswith() and endswith() for re's would be more intuitive
- From: Bruno Desthuilliers
- startswith() and endswith() for re's would be more intuitive
- Prev by Date: Re: remove the last character or the newline character?
- Next by Date: Re: XSLT speed comparisons
- Previous by thread: Re: startswith() and endswith() for re's would be more intuitive
- Next by thread: remove the last character or the newline character?
- Index(es):
Relevant Pages
|