def expr_match(line, expr):
    if line == expr:
        return True
    if fnmatch.fnmatch(line, expr):
        return True
    try:
        if re.match(r'\A{0}\Z'.format(expr), line):
            return True
    except re.error:
        pass
    return False
Evaluate a line of text against an expression. First try a full-string
dataset/ETHPy150Open saltstack/salt/salt/utils/__init__.py/expr_match