code: def _starts_with_regex(line, regex):
      
      if not regex.startswith('^'):
          regex = '^' + regex
      reg = re.compile(regex)
      return reg.match(line)
docs: Return whether a line starts with a regex or not.