code: function pathToRegExp(path, keys) {
  	path = path
  		.concat('/?')
  		.replace(/\/\(/g, '(?:/')
  		.replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?|\*/g, function(_, slash, format, key, capture, optional) {
  			if (_ === '*') {
  				return _;
  			}
  
  			keys.push(key);
  			slash = slash || '';
  			return '' + (optional ? '' : slash) + '(?:' + (optional ? slash : '') + (format || '') + (capture || '([^/]+?)') + ')' + (optional || '');
  		})
  		.replace(/([\/.])/g, '\\$1')
  		.replace(/\*/g, '(.*)');
  	return new RegExp('^' + path + '$', 'i');
  }
docs: Transforms a string into a regular expression.
  This function is from the project Routes.js, under the MIT licence,
  {@link https://github.com/aaronblohowiak/routes.js} it's present
  in the file {@link https://github.com/aaronblohowiak/routes.js/blob/bdad0a1ae10d11981bb286550bb3b8a1a71909bd/dist/routes.js#L49}.
  
  @param  {!string} path String path.
  @param  {!Array.<string>} keys Empty array to be filled with the
  keys ids.
  @return {!RegExp} Regular expression.