Python's regular expression?

Mirco Wahab peace.is.our.profession at gmx.de
Mon May 8 09:54:47 EDT 2006


Hi John

>> But what would be an appropriate use
>> of search() vs. match()? When to use what?
> 
> ReadTheFantasticManual :-)

>From the manual you mentioned, i don't get
the point of 'match'. So why should you use
an extra function entry match(),

    re.match('whatever', t):

which is, according to the FM,
equivalent to (a special case of?)

    re.search('^whatever', t):

For me, it looks like match() should
be used on simple string comparisons
like a 'ramped up C-strcmp()'.

Or isn't ist? Maybe I dont get it ;-)

Thanks

Mirco



More information about the Python-list mailing list