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