def regex_select(env=None, app=None, request=None):
    """
    select a set of regex rewrite params for the current request
    """
    if app:
        THREAD_LOCAL.routes = params_apps.get(app, params)
    elif env and params.routes_app:
        if routers:
            map_url_in(request, env, app=True)
        else:
            app = regex_uri(env, params.routes_app, "routes_app")
            THREAD_LOCAL.routes = params_apps.get(app, params)
    else:
        THREAD_LOCAL.routes = params  # default to base rewrite parameters
    log_rewrite(THREAD_LOCAL.routes.name % "select routing parameters: %s")
    return app  # for doctest
dataset/ETHPy150Open uwdata/termite-visualizations/web2py/gluon/rewrite.py/regex_select/swapped operands of `%`