results = defaultdict(lambda : [])
for match in re.finditer('(?P<b>.b.)|(?P<i>.i.)', 'abcdefghijkabcdefghijk'):
    for k, v in match.groupdict().items():
        if v is not None:
            results[k].append(v)
results
Possible to retrieve an arbitrary unordered set of named groups in one swoop with Python's re module?