Find which token has been matched by compound regex

def get_matched_token(self, match):
        """Find which token has been matched by compound regex"""
        match_groupdict = match.groupdict()
        for group in self.groups:
            if match_groupdict[group] is not None:
                token, match_type = self.groups[group]
                return (token, match_type, group)