def term_regex(term):
    """
    Returns a case-insensitive regex for searching terms
    """
    return re.compile(r'^{0}$'.format(re.escape(term)), re.IGNORECASE)
def term_regex ( term ) : return re . compile ( r'^{0}$' . format ( re . escape ( term ) ) , re . IGNORECASE )
Returns a case-insensitive regex for searching terms