Why re.match()?

Aahz aahz at pythoncraft.com
Fri Jul 3 16:31:36 CEST 2009


In article <h2l1kc$2tj$1 at reader1.panix.com>, kj  <no.email at please.post> wrote:
>In <025db0a6$0$20657$c3e8da3 at news.astraweb.com> Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> writes:
>>On Thu, 02 Jul 2009 11:19:40 +0000, kj wrote:
>>>
>>> If the concern is efficiency for such cases, then simply implement
>>> optional offset and length parameters for re.search(), to specify any
>>> arbitrary substring to apply the search to.  To have a special-case
>>> re.match() method in addition to a general re.search() method is
>>> antithetical to language minimalism, and plain-old bizarre.  Maybe
>>> there's a really good reason for it, but it has not been mentioned yet.
>>
>>There is, and it has.
>
>I "misspoke" earlier.  I should have written "I'm *sure* there's
>a really good reason for it."  And I think no one in this thread
>(myself included, of course) has a clue of what it is.  I miss the
>days when Guido still posted to comp.lang.python.  He'd know. 

You may find this enlightening:

http://www.python.org/doc/1.4/lib/node52.html
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"as long as we like the same operating system, things are cool." --piranha



More information about the Python-list mailing list