def METHOD_NAME(pattern, lines):
    """Match a regular expression against a list of strings.
    Return the index of the first matched line and the match object.
    None, None if nothing matched.
    """
    for i, line in enumerate(lines):
        m = re.match(pattern, line)
        if m:
            return i, m
    else:
        return None, None