Testing for the first few letters of a string

magloca magloca at mailinater.com
Thu Aug 7 17:08:10 EDT 2008


John Machin wrote:

>> import re
>> template = '^My name is alex'
> 
> The ^ is redundant.

Didn't the OP want to match only at the beginning of the string?

m.



More information about the Python-list mailing list