src/Matcher.php
protected function parsePlaceholders($pattern)
    {
        $params = [];
        $parser = $this->parser;

        preg_match_all("~" . $parser::DYNAMIC_REGEX . "~x", $pattern, $matches, PREG_SET_ORDER);

        foreach ((array) $matches as $key => $match) {
            $pattern = str_replace($match[0], isset($match[2]) ? "({$match[2]})" : "([^/]+)", $pattern);
            $params[$key] = $match[1];
        }

        return [$pattern, $params];
    }
protected function parsePlaceholders($pattern)
    {
        $params = [];
        $parser = $this->parser;

        preg_match_all("~" . $parser::DYNAMIC_REGEX . "~x", $pattern, $matches, PREG_SET_ORDER);

        foreach ((array) $matches as $key => $match) {
            $pattern = str_replace($match[0], isset($match[2]) ? "({$match[2]})" : "([^/]+)", $pattern);
            $params[$key] = $match[1];
        }

        return [$pattern, $params];
    }
protected function parsePlaceholders ( $ pattern ) { $ params = [ ] ; $ parser = $ this -> parser ; preg_match_all ( "~" . $ parser :: DYNAMIC_REGEX . "~x" , $ pattern , $ matches , PREG_SET_ORDER ) ; foreach ( ( array ) $ matches as $ key => $ match ) { $ pattern = str_replace ( $ match [ 0 ] , isset ( $ match [ 2 ] ) ? "({$match[2]})" : "([^/]+)" , $ pattern ) ; $ params [ $ key ] = $ match [ 1 ] ; } return [ $ pattern , $ params ] ; }
Parse an route pattern seeking for parameters and build the route regex.

@param string $pattern
@return array 0 => new route regex, 1 => map of parameter names
Parse an route pattern seeking for parameters and build the route regex .