src/Routing/RoutingResolver.php
private function getRegexProperties(RoutingRuleAbstract $rule) {
        $requiredMatches = array();
        $ruleRegex = $rule->getRegularExpression();

        preg_match_all($this->requiredInputPattern, $ruleRegex, $requiredMatches);
        $pathRequiredVars = $requiredMatches[0];
        preg_match_all($this->catchAllInputPattern, $ruleRegex, $requiredMatches);
        $pathCatchAllVars = $requiredMatches[0];

        $urlRegexRequired = str_replace($pathRequiredVars,
                "([" . $this->allowedInputValues . "]+)", $ruleRegex);
        $urlRegex = str_replace($pathCatchAllVars, "(.*)", $urlRegexRequired);


        $urlRegexReplaced = str_replace("/", "\/", $urlRegex);
        $finalUrlRegex = "/^" . $urlRegexReplaced . "?$/";

        $inputsRequired = str_replace(":", "", $pathRequiredVars);
        $inputsCatchAll = str_replace("*", "", $pathCatchAllVars);

        return array($finalUrlRegex, array_merge(array(), $inputsRequired,
                    $inputsCatchAll));
    }
private function getRegexProperties(RoutingRuleAbstract $rule) {
        $requiredMatches = array();
        $ruleRegex = $rule->getRegularExpression();

        preg_match_all($this->requiredInputPattern, $ruleRegex, $requiredMatches);
        $pathRequiredVars = $requiredMatches[0];
        preg_match_all($this->catchAllInputPattern, $ruleRegex, $requiredMatches);
        $pathCatchAllVars = $requiredMatches[0];

        $urlRegexRequired = str_replace($pathRequiredVars,
                "([" . $this->allowedInputValues . "]+)", $ruleRegex);
        $urlRegex = str_replace($pathCatchAllVars, "(.*)", $urlRegexRequired);


        $urlRegexReplaced = str_replace("/", "\/", $urlRegex);
        $finalUrlRegex = "/^" . $urlRegexReplaced . "?$/";

        $inputsRequired = str_replace(":", "", $pathRequiredVars);
        $inputsCatchAll = str_replace("*", "", $pathCatchAllVars);

        return array($finalUrlRegex, array_merge(array(), $inputsRequired,
                    $inputsCatchAll));
    }
Arranges all changes based on rule and returns a real Regex, not an URL format
(based on routing rules), and a list of input params.

@param RoutingRuleAbstract $rule
@return list(string regex, array<string> inputs)