With the re/sre module included with Python 2.4:
pattern = (?Pid1avi)|(?Pid2avi|mp3)
string2match = some string with avi in it
matches = re.finditer(pattern, string2match)
...
matches[0].groupdict()
{'id2': None, 'id1': 'avi'}
Which was expected since overlapping matches are ignored.
But I would
André Søreng wrote:
With the re/sre module included with Python 2.4:
pattern = (?Pid1avi)|(?Pid2avi|mp3)
string2match = some string with avi in it
matches = re.finditer(pattern, string2match)
...
matches[0].groupdict()
{'id2': None, 'id1': 'avi'}
Which was expected since overlapping