Return a dictionary containing all the named subgroups of the match, keyed by the subgroup name. default Is used for groups that did not participate in the match.
>>> m = re.search(r"(?P<adjective>\w+) (?P<animal>\w+)", "killer rabbit") >>> m.groupdict() {'adjective': 'killer', 'animal': 'rabbit'}
re/Match.groupdict
Match.groupdict