I kind of wish that there were a version of re.findall
that returned groupdict
s instead of just group
s. Am I missing some simple way to accomplish the same result? (Does anybody know of a reason that this function doesn't exist?)
You could use the finditer() function. This will give you a sequence of match objects, so you can get the groupdict for each with:
[m.groupdict() for m in regex.finditer(search_string)]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With