@jinja_filter('regex_match')
def regex_match(txt, rgx, ignorecase=False, multiline=False):
    '''
    Searches for a pattern in the text.