Problem with RE matching backslash

Jeff Epler jepler at unpythonic.net
Tue Jan 27 11:37:04 EST 2004


On Tue, Jan 27, 2004 at 03:31:24PM +0000, Ladv�nszky K�roly wrote:
> Thanks for your quick and very helpful reply, Peter.
> What is still not clear to me is why  the search examples work and yield
> 'm'.

Because the first pattern, which you wrote as "\\m", will match a lone
'm'.  So 'match' fails, because m is not in the first position.  But
'search' succeeds at index 1.

Jeff




More information about the Python-list mailing list