code: def find_first_regex_match(key, regex_candidates):
      
      for cand in regex_candidates:
          try:
              pattern = re.compile(cap_match_string(cand))
              if pattern.match(key):
                  return cand
          except:
              logging.warn('[ros_interface] Ignoring invalid regex string "{0!s}"!'.format(cand))
  
      return None
docs: find the first regex that match with the key
      :param key: a key to try to match against multiple regex
      :param match_candidates: a list of regexes to check if they match the key
      :return: the first candidate found