"Mystilleef" wrote: > 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?
your definition of "overlapping" seems to be a bit odd, but assuming your description is correct, the answer is no. on the other hand, if you only want one hit, why not use "search" instead of "findall" ? </F> -- http://mail.python.org/mailman/listinfo/python-list