How to find all possibly overlapping matches?
no.email at please.post
Wed Aug 12 20:00:16 CEST 2009
In <mailman.7.1250097801.2903.python-list at python.org> MRAB <python at mrabarnett.plus.com> writes:
>> re.findall finds all non-overlapping matches, but what if one wants
>> all (maximal) matches, even those that overlap?
>> All the solutions I can come up involve calling re.search iteratively,
>> each time giving it a pos parameter starting just after the start
>> of the previous match.
>> Is there a built-in solution to such a task?
>Not in the re module.
>It has been requested and is in my regex implementation at
>http://bugs.python.org/issue2636 if you want to try that.
More information about the Python-list