code: def get_matched_token(self, match):
          
          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)
docs: Find which token has been matched by compound regex