def regex_filter_in(e):
 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

def regex_filter_in ( e ) : 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
regex rewrite incoming url .