code: function(route) 
  	{
  		var rootStripper 	= /^\/+|\/+$/g;
  		var optionalParam 	= /\((.*?)\)/g;
  		var namedParam		= /(\(\?)?:\w+/g;
  		var splatParam		= /\*\w+/g;
  		var escapeRegExp	= /[\-{}\[\]+?.,\\\^$|#\s]/g;
  		
  		route = route
  			.replace(rootStripper, '')
  			.replace(escapeRegExp, '\\$&')
  			.replace(optionalParam, '(?:$1)?')
  			.replace(namedParam, function(match, optional)
  			{
  				return optional ? match : '([^\/]+)';
  			})
  			.replace(splatParam, '(.*?)');
  		
  		return new RegExp('^' + route + '$');
  	}
docs: Convert a route string into a regular expression, suitable for matching
  against the current location hash.
  
  @private