Re: startswith() and endswith() for re's would be more intuitive

2006-09-28 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, metaperl wrote: > 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. The only reason for those special cases for simple string match

Re: startswith() and endswith() for re's would be more intuitive

2006-09-28 Thread Fredrik Lundh
metaperl wrote: > Nothing. There is also nothing wrong with > > re.match('blah', somestring) > > but it does read as well as > > re.atstartof('blah', something) yuck. > and the counterpart for EOS is not there. sure is; it's spelled: re.match('.*blah$', somestring) -- http://mail.p

Re: startswith() and endswith() for re's would be more intuitive

2006-09-28 Thread metaperl
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). > >

Re: startswith() and endswith() for re's would be more intuitive

2006-09-28 Thread John Salerno
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

Re: startswith() and endswith() for re's would be more intuitive

2006-09-28 Thread Bruno Desthuilliers
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').atstarto

startswith() and endswith() for re's would be more intuitive

2006-09-28 Thread metaperl
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. I suggest: re.compile('blah').atstartof(string) re.compile('blah').atendof(string) But it will never happen. -- http://m