In article <ma*************************************@python.or g>, km wrote:
Hi all,
python re module deals with only nonoverlapping matches. how to go for if i want to find out overlapping matches and their span ?
regards,
KM
The easiest way would be to, after you've found a match (using something
like the search method of comipiled re's), repeat the search starting
one character further along that the start of the previously found
match. This strategy may require some adjustment depending on the
exact patterns you're using, since you may find you don't want
_all_ overlapping patterns, but it should work and I can't think of
a better way of doing it.
Cheers,
Ken