How to match where the search started?

Florian Kaufmann sensorflo at gmail.com
Tue Sep 28 10:20:24 CEST 2010


The thing is that the (\=|...) group is not really part of the match.
I think this gives you more the idea what I want

reo = re.compile( r'(\=|.)...' );
while True
  mo = reo.search(text,pos)
  if not mo: break
  if text[mo.start()] == '\\'
    # a pseudo match. continue after the backslash
  else
    # a real match. continue after the match



More information about the Python-list mailing list