import re


def regex_check_rules(line, compiled_rules):
    """Check the given line against a set of regular expressions

    Arguments:
        line {string}         -- the line of code possibly
        compiled_rules {list} -- set of regular expressions
                                 to evaluate against line

    Returns:
        string -- the first match found evaluating compiled_rules
    """
    for rule in compiled_rules:
        match = re.search(compiled_rules[rule], line)
        if bool(match):
            return match.group(), rule
    return None, None