On Thu, 07 Aug 2008 23:08:10 +0200, magloca <magloca@mailin ater.comwrote:
That's why it's "redundant" instead of "incorrect" . ;)
re.match = match(pattern, string, flags=0)
Try to apply the pattern at the *start* of the string, returning
a match object, or None if no match was found.
Emphasis mine.
Jean-Paul
>John Machin wrote:
>
>>
>The ^ is redundant.
>
>Didn't the OP want to match only at the beginning of the string?
>
>
>>import re
>>template = '^My name is alex'
>>template = '^My name is alex'
>The ^ is redundant.
>Didn't the OP want to match only at the beginning of the string?
>
re.match = match(pattern, string, flags=0)
Try to apply the pattern at the *start* of the string, returning
a match object, or None if no match was found.
Emphasis mine.
Jean-Paul