Given a route, and a URL fragment that it matches, return the array of extracted decoded parameters. Empty or unmatched parameters will be treated as `null` to normalize cross-browser behavior.
547422
function(route, fragment) {
      var params = route.exec(fragment).slice(1);
      return _.map(params, function(param, i) {
        // Don't decode the search params.
        if (i === params.length - 1) return param || null;
        return param ? decodeURIComponent(param) : null;
      });
    }
1334189
def _get_path_params(match):
    
    result = {}
    for var_name, value in match.groupdict().iteritems():
      actual_var_name = ApiConfigManager._from_safe_path_param_name(var_name)
      result[actual_var_name] = urllib.unquote_plus(value)
    return result
1634
def match(self, url: str) -> RouteResolved:
        
        url = normalize_url(url)
        parts = self._deconstruct_url(url)
        return self._match(parts)
1231593
def url_to_params(*args)
      if args.size < 2
        path = args[0]
        method = :client
      else
        path = args[1]
        method = args[0].to_sym
      end

      # First try a direct match
      result = @direct_routes[method][path]
      return result if result

      # Next, split the url and walk the sections
      parts = url_parts(path)

      match_path(parts, parts, @indirect_routes[method])
    end
940949
private String[] decodePathTokens(String uri) {
		// Need to split the original URI (instead of QueryStringDecoder#path) then decode the tokens (components),
		// otherwise /test1/123%2F456 will not match /test1/:p1

		int qPos = uri.indexOf("?");
		String encodedPath = (qPos >= 0) ? uri.substring(0, qPos) : uri;

		String[] encodedTokens = PathPattern.removeSlashesAtBothEnds(encodedPath).split("/");

		String[] decodedTokens = new String[encodedTokens.length];
		for (int i = 0; i < encodedTokens.length; i++) {
			String encodedToken = encodedTokens[i];
			decodedTokens[i] = QueryStringDecoder.decodeComponent(encodedToken);
		}

		return decodedTokens;
	}
75046
public static function extractLocaleSegmentFromParameters(Scope $scope, string $routeKey, array &$parameters = [])
    {
        $localeSegment = null;

        // If none given, we should be returning the current active locale segment
        // If value is explicitly null, we assume the current locale is expected
        if (!array_key_exists($routeKey, $parameters) || is_null($parameters[$routeKey])) {
            return $scope->activeSegment();
        }

        if ($scope->validateSegment($parameters[$routeKey])) {
            $localeSegment = $parameters[$routeKey];
        }

        // If locale segment parameter is not a 'real' parameter, we ignore this value and use the current locale instead
        // The 'wrong' parameter will be passed along but without key
        if ($localeSegment != $parameters[$routeKey]) {
            $parameters[] = $parameters[$routeKey];
        }

        unset($parameters[$routeKey]);

        return $localeSegment;
    }
961549
private static String decodeURL(String url) {
    	try {
			return URLDecoder.decode(url, UTF_8);
		} catch (UnsupportedEncodingException e) {
		}
		return null;
    }
1276858
def match(self, route):
        
        _resource = trim_resource(self.resource)
        self.method = self.method.lower()
        resource_match = route.resource_regex.search(_resource)
        if resource_match is None:
            return None

        # build params and querystring
        params = resource_match.groupdict()
        querystring = params.pop("querystring", "")
        setattr(self, "param", params)
        setattr(self, "query", parse_querystring(querystring))

        return copy.deepcopy(self)
1164811
def urlparams(url_, hash=None, **query):
    
    url = urlparse.urlparse(url_)
    fragment = hash if hash is not None else url.fragment

    # Use dict(parse_qsl) so we don't get lists of values.
    q = url.query
    query_dict = dict(urlparse.parse_qsl(smart_str(q))) if q else {}
    query_dict.update((k, v) for k, v in query.items())

    query_string = _urlencode([(k, v) for k, v in query_dict.items()
                               if v is not None])
    new = urlparse.ParseResult(url.scheme, url.netloc, url.path, url.params,
                               query_string, fragment)
    return new.geturl()
605773
function compareUrlRoute(currentURL, currentRoute) {
                var regex = /\{(.*)\}/i;
                var arraySize = currentRoute.length,
                    testValue = false;
                for (var i = 0; i < arraySize; i++) {
                    var dynamic = regex.exec(currentRoute[i]);
                    if (dynamic) {
                        document.routeParams[dynamic[1]] = currentURL[i];
                    } else {
                        if (currentRoute[i] === currentURL[i]) {
                            testValue = true;
                        }
                    }
                }

                return testValue;
            }
844556
@SuppressWarnings("PMD.PreserveStackTrace")
    private Map<String, String> findParameters(URI location) throws MalformedURLException {
        final Map<String, String> params;
        try {
            params = URISupport.parseParameters(location);
        } catch (final URISyntaxException e) {
            throw new MalformedURLException(e.getMessage());
        }
        return params;
    }
899000
def _extract_params(self):
        
        # Because in this endpoint we handle both GET
        # and POST request.
        query_dict = (self.request.POST if self.request.method == 'POST'
                      else self.request.GET)

        self.params['client_id'] = query_dict.get('client_id', '')
        self.params['redirect_uri'] = query_dict.get('redirect_uri', '')
        self.params['response_type'] = query_dict.get('response_type', '')
        self.params['scope'] = query_dict.get('scope', '').split()
        self.params['state'] = query_dict.get('state', '')
        self.params['nonce'] = query_dict.get('nonce', '')

        self.params['prompt'] = self._allowed_prompt_params.intersection(
            set(query_dict.get('prompt', '').split()))

        self.params['code_challenge'] = query_dict.get('code_challenge', '')
        self.params['code_challenge_method'] = query_dict.get('code_challenge_method', '')
61427
def process_route(pattern, keys, conditions, block = nil, values = [])
      route = @request.path_info
      route = '/' if route.empty? and not settings.empty_path_info?
      return unless match = pattern.match(route)
      values += match.captures.to_a.map { |v| force_encoding URI.decode_www_form_component(v) if v }

      if values.any?
        original, @params = params, params.merge('splat' => [], 'captures' => values)
        keys.zip(values) { |k,v| Array === @params[k] ? @params[k] << v : @params[k] = v if v }
      end

      catch(:pass) do
        conditions.each { |c| throw :pass if c.bind(self).call == false }
        block ? block[self, values] : yield(self, values)
      end
    ensure
      @params = original if original
    end
1313392
def get_p2o_params_from_url(cls, url):
        

        # if the url doesn't contain a filter separator, return it
        if PRJ_JSON_FILTER_SEPARATOR not in url:
            return {"url": url}

        # otherwise, add the url to the params
        params = {'url': url.split(' ', 1)[0]}
        # tokenize the filter and add them to the param dict
        tokens = url.split(PRJ_JSON_FILTER_SEPARATOR)[1:]

        if len(tokens) > 1:
            cause = "Too many filters defined for %s, only the first one is considered" % url
            logger.warning(cause)

        token = tokens[0]
        filter_tokens = token.split(PRJ_JSON_FILTER_OP_ASSIGNMENT)

        if len(filter_tokens) != 2:
            cause = "Too many tokens after splitting for %s in %s" % (token, url)
            logger.error(cause)
            raise ELKError(cause=cause)

        fltr_name = filter_tokens[0].strip()
        fltr_value = filter_tokens[1].strip()

        params['filter-' + fltr_name] = fltr_value

        return params
135657
def _extract_path_parameters_from_paths(paths):
    
    params = set()
    for path in paths:
        parts = PART_REGEX.split(path)
        for p in parts:
            match = PARAM_REGEX.match(p)
            if match:
                params.add(match.group("name"))
    return params
559667
function getURLParameter( name ) {
    return decodeURI(
        ( new RegExp( name + '=' + '(.+?)(&|$)' ).exec( location.search ) || [ null, null ] )[ 1 ]
    );
}
1051654
public static List<String> extractParameters(String rawRoute) {
        List<String> list = new ArrayList<>();

        Matcher m = PATH_PARAMETER_REGEX.matcher(rawRoute);

        while (m.find()) {
            if (m.group(1).indexOf('<') != -1) {
                // Regex case name<reg>
                list.add(m.group(1).substring(0, m.group(1).indexOf('<')));
            } else if (m.group(1).indexOf('*') != -1) {
                // Star case name*
                list.add(m.group(1).substring(0, m.group(1).indexOf('*')));
            } else if (m.group(1).indexOf('+') != -1) {
                // Plus case name+
                list.add(m.group(1).substring(0, m.group(1).indexOf('+')));
            } else {
                // Basic case (name)
                list.add(m.group(1));
            }
        }

        return list;
    }