Metacharacter +: one or more occurrences. What is the general method to get the number of this occurrences?
For example:
import re
x = re.finditer(r'0(10)+(20)+', '0001010202020000')
for i in iter(x):
print(i) # <re.Match object; span=(2, 13), match='01010202020'>
I want to get: [('01', 2), ('02', 3)] due to (10)+ and (20)+ in regex.