Suppose I have a string:
string = 'AvBvC'
I want to match A
, B
, and C
, and this is what I did:
match = re.search('(.*)v(.*)', string)
print match.groups()
The problem is, the result shows that:
('AvB', 'C',)
instead of what I want, which is
('A', 'B', 'C',)
How do I make it catch all overlapping patterns..?
Thanks.
(I know there are some posts concerning the same issue, but haven't found a definite answer for Python)