Regular expression intricacies: why do REs skip some matches?

Diez B. Roggisch deets at nospam.web.de
Tue Apr 11 18:48:31 EDT 2006


> Is this simply not the way REs work? Does this sort of matching really
> have to be home-coded?

Yes. The reason is basically that consumed characters can't be 
"unconsumed". However, if you use the search-variant with a 
start-argument you can search from the last occurence start+1 to achieve 
what you're after.

Diez



More information about the Python-list mailing list