def regex_filter_in(e):
    "regex rewrite incoming URL"
    routes = THREAD_LOCAL.routes
    query = e.get('QUERY_STRING', None)
    e['WEB2PY_ORIGINAL_URI'] = e['PATH_INFO'] + (query and ('?' + query) or '')
    if routes.routes_in:
        path = regex_uri(e, routes.routes_in,
                         "routes_in", e['PATH_INFO'])
        rmatch = regex_redirect.match(path)
        if rmatch:
            raise HTTP(int(rmatch.group(1)), location=rmatch.group(2))
        items = path.split('?', 1)
        e['PATH_INFO'] = items[0]
        if len(items) > 1:
            if query:
                query = items[1] + '&' + query
            else:
                query = items[1]
            e['QUERY_STRING'] = query
    e['REQUEST_URI'] = e['PATH_INFO'] + (query and ('?' + query) or '')
    return e
dataset/ETHPy150Open uwdata/termite-visualizations/web2py/gluon/rewrite.py/regex_filter_in/original