Takes a `route` (ex: '/posts/:post') and returns
the name of the parameter (ex: 'post'), which should be a route type

@params {String} route
@returns {String}
169682
function getRouteType (route) {
  var match = route.match(/\:(post|page|tag|category)\b/);
  if (match && match.length > 1)
    return match[1];
  return null;
}
640416
function defineRoute (server, opts) {

    server.route({
        method: 'GET',
        path: '/bomb',
        handler: handler,
        config: {
            jsonp: 'callback',
            validate: {
                query: {
                    count: Hapi.types.Number()
                },
                payload: false
            }
        }
    });

    function handler (req) {
        var count = (req.query.count || opts.defaultBombCount);
        var res = {};
        res[opts.plural] = _.sample(opts.things, count);
        req.reply(res);
    }

}
1076322
function getRoute(node) {
	var id = "";

	var parent = node.parentNode;
	var index = -1;

	if(!parent) {
		return {id:"0"};
	}

	var child = parent.firstChild;
	while(child) {
		index++;
		if(child === node) {
			break;
		}
		child = child.nextSibling;
	}

	// ARG!

	var parentInfo = parent.nodeType === 9 ? {id:""} :
		getCachedInfo(parent) || getRoute(parent);

	var parentId = parentInfo.id;

	id = (parentId ? parentId + SEPARATOR : "") + index;

	var routeInfo = {
		id: id,
		branch: getBranch(index, node, parentInfo.branch)
	};
	cache(node, routeInfo);

	return routeInfo;
}
532984
function routePath (route) {
  if (!route) return ''
  return route.path || (route.regexp && route.regexp.source) || ''
}
116485
function ParamRoutePath(routePath) {
        this.routePath = routePath;
        this.terminal = true;
        this._assertValidPath(routePath);
        this._parsePathString(routePath);
        this.specificity = this._calculateSpecificity();
        this.hash = this._calculateHash();
        var lastSegment = this._segments[this._segments.length - 1];
        this.terminal = !(lastSegment instanceof ContinuationPathSegment);
    }
1020212
function getActiveRoutes(params) {
        var activeRoutes = {},
            availableRoutes =
            {
                'index': 'GET     /',
                'create': 'POST    /',
                'new': 'GET     /new',
                'edit': 'GET     /:id/edit',
                'destroy': 'DELETE  /:id',
                'update': 'PUT     /:id',
                'show': 'GET     /:id',
                'destroyall': 'DELETE  /'
            },
            availableRoutesSingleton =
            {
                'show': 'GET     /show',
                'create': 'POST    /',
                'new': 'GET     /new',
                'edit': 'GET     /edit',
                'destroy': 'DELETE  /',
                'update': 'PUT     /',
                'destroyall': 'DELETE  /'
            };

        if (params.singleton) {
            availableRoutes = availableRoutesSingleton;
        }

        // 1. only
        if (params.only) {
            if (typeof params.only === 'string') {
                params.only = [params.only];
            }
            params.only.forEach(function (action) {
                if (action in availableRoutes) {
                    activeRoutes[action] = availableRoutes[action];
                }
            });
        }
        // 2. except
        else if (params.except) {
            if (typeof params.except === 'string') {
                params.except = [params.except];
            }
            for (var action1 in availableRoutes) {
                if (params.except.indexOf(action1) === -1) {
                    activeRoutes[action1] = availableRoutes[action1];
                }
            }
        }
        // 3. all
        else {
            for (var action2 in availableRoutes) {
                activeRoutes[action2] = availableRoutes[action2];
            }
        }

        return activeRoutes;
    }
422637
private String cleanRoute(String route) {
        if (!route.startsWith("/")) {
            route = "/" + route;
        }

        if (route.endsWith("/")) {
            route = route.substring(0, route.length() - 1);
        }

        return route;
    }
453415
function (params, route) {
                // Due to how our routing accepts arbitrary length folders 
                // The key param could be split between params.key and params.'0'
                // Return the combined keys
                var restOfKey = params['0'] || '';

                var key = params.key + restOfKey;

                // Check if this route ends with a / ensure the key also does (similar to strict routing)
                if (route.path.slice(-1) === '/' && key.slice(-1) !== '/') {
                    key = key + '/';
                }

                return key;
            }
1352001
function getRoute(params) {
    params.route = params.route || "";
    var localeRoute = utils.getLocaleRoute(),
        pageRoute = localeRoute + "/:page/",
        settingsRoute = utils.getAppSettingsRoute() + "/";

    return (params.isAppRoute ? AppURL + "/" : params.settings ? settingsRoute : pageRoute)
        + params.pluginId + (params.many ? "/:iId" : "") + params.route
}
1282508
function Route(method, route, fn) {
    this.method = method;
    this.route = route;
    this.fn = fn;

    return function (app) {
        var middleware = exports.isAppSettingsRoute(route) ? utils.getSettingsMiddlewares() :
            utils.getRequestMiddlewares();

        if (method == "get") {
            app.get(route, middleware, fn)
        }
        else if (method == "post") {
            app.post(route, middleware, fn);
        }
//        var methodRoutes = app.routes[method];
//        return methodRoutes[methodRoutes.length - 1];
    };
}
914165
function(route) {
  if (!route) {
    return null;
  }
  var idx = route.indexOf('.');
  if (idx < 0) {
    return null;
  }
  return route.substring(0, idx);
}
1191680
function param(err) {
    if (err) {
      return done(err);
    }

    if (i >= keys.length ) {
      return done();
    }

    paramIndex = 0;
    key = keys[i++];
    name = key.name;
    paramVal = req.params[name];
    paramCallbacks = params[name];
    paramCalled = called[name];

    if (paramVal === undefined || !paramCallbacks) {
      return param();
    }

    // param previously called with same value or error occurred
    if (paramCalled && (paramCalled.match === paramVal
      || (paramCalled.error && paramCalled.error !== 'route'))) {
      // restore value
      req.params[name] = paramCalled.value;

      // next param
      return param(paramCalled.error);
    }

    called[name] = paramCalled = {
      error: null,
      match: paramVal,
      value: paramVal
    };

    paramCallback();
  }
304604
function getRoutes(req, res) {
        var index = {
            name: about.name,
            version: about.version,
            description: about.description,
            routes: app.routes
        };
        return res.json(index);
    }
1144548
function fixRoute(route) {
	
	//protect special chars while we replace
	return route.replace(/\s*OR\s*/g,'__OR__').
	replace(/\s*->\s*/g,'__->__').
	replace(/[\s\t\n]+/g,'/').
	replace(/__/g,' ');
}
580264
public function convertRouteParam($route)
    {
        $patterns = array(
            ':any?' => ':[a-zA-Z0-9\.\-_%=]?+',
            ':num?' => ':[0-9]?+',
            ':all?' => ':.?*',
            ':num' => ':[0-9]+',
            ':any' => ':[a-zA-Z0-9\.\-_%=]+',
            ':all' => ':.*',
        );

        $route = str_replace(array_keys($patterns), array_values($patterns), $route);

        return $route;
    }
884441
public function parse($route)
    {
        // reset param names
        $this->paramNames = [];

        // replace shortcuts
        $regex = strtr($route, $this->shortcuts);

        // replace param names that doesn't include shortcuts or regex
        $regex = preg_replace_callback('/{([a-zA-Z0-9]+)}/', [$this, 'replaceWithoutRegex'], $regex);

        // replace param names that includes shortcuts or regex
        $regex = preg_replace_callback('/{([a-zA-Z0-9]+):/', [$this, 'replaceWithRegex'], $regex);

        // replace ending grouping
        $regex = str_replace('}', ')', $regex);

        // fix slashes when optional params are present
        $regex = $this->fixOptionalSlashes($regex);

        // fix for handling trailing slashes
        $regex .= '(/)?';

        // return regex and param names
        return ['#^'. $regex .'$#', $this->paramNames];
    }
903736
function(route){
    var res;

    if(route[0] === '/' && route[route.length-1] === '/' ) {
      res = new RegExp(route.slice(1, route.length-1), '');
      res._isRegexp = true;
    }
    else if(typeof route == 'string'){
      res = Backbone.Router.prototype._routeToRegExp.call(this, route);
      res._isString = true;
    }

    return res;
  }