(pattern, path)
return re.search(regex, path)
Given a pattern (ie the contents of the pattern column in the route table) and the
    path of an incoming request (without the leading slash), convert the
    pattern to a regex and return a match object captured from the path
Given a pattern (ie the contents of the pattern column in the route table) and the
    path of an incoming request (without the leading slash), convert the
    pattern to a regex and return a match object captured from the path
Given a pattern ( ie the contents of the pattern column in the route table ) and the path of an incoming request ( without the leading slash ) convert the pattern to a regex and return a match object captured from the path
def search_path(pattern, path):
    """
    Given a pattern (ie the contents of the pattern column in the route table) and the
    path of an incoming request (without the leading slash), convert the
    pattern to a regex and return a match object captured from the path
    """
    regex = pattern_to_regex(pattern)
    if regex.endswith("/$"):
        regex = regex[:-2] + "/?$"
    return re.search(regex, path)
def search_path ( pattern , path ) : regex = pattern_to_regex ( pattern ) if regex . endswith ( "/$" ) : regex = regex [ : - 2 ] + "/?$" return re . search ( regex , path )