How to match where the search started?

Florian Kaufmann sensorflo at gmail.com
Tue Sep 28 12:32:10 EDT 2010


> If you want to anchor the regex at the start position 'pos' then use
> the 'match' method instead.

The wickedly problem is that matching at position 'pos' is not a
requirement, its an option. Look again at my 2nd example, the
r'(\=|.)...' part, which (of course wrongly) assumes that \= means
'match at the beginning of the search'. Before the match I am really
interested in, there is the start of the search, OR there is any
character.



More information about the Python-list mailing list