Overlapping Regular Expression Matches With findall()

Mystilleef mystilleef at gmail.com
Thu Dec 15 14:55:36 CET 2005


Hello,

Is there a simple flag to set to allow overlapping matches
for the findall() regular expression method? In other words,
if a string contains five occurrences of the string pattern
"cat", calling findall on the string returns a list
containing five "cat" strings. Is it possible for findall()
to just return one "cat" string?

Thanks




More information about the Python-list mailing list