On 28/09/2010 17:32, Florian Kaufmann wrote:
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.

An alternative is to use the 'regex' module, available from PyPI:

    http://pypi.python.org/pypi/regex

It has \G, which is the anchor for the start position.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to