protected function prepareRoutePattern($route): string
    {
        $pattern = str_replace('/', '\/', $route);

        foreach ($this->getParams() as $param => $type) {
            switch ($type) {
                case 'int':
                case 'integer':
                    $pattern = str_replace("{\$$param}", "(?P<$param>[0-9]+)", $pattern);
                    break;
                case 'float':
                    $pattern = str_replace("{\$$param}", "(?P<$param>[0-9.,]+)", $pattern);
                    break;
                case 'string':
                case 'module':
                case 'controller':
                    $pattern = str_replace(
                        "{\$$param}",
                        "(?P<$param>[a-zA-Z0-9-_.]+)",
                        $pattern
                    );
                    break;
            }
        }
        return '/^' . $pattern . '/i';
    }
protected function prepareRoutePattern($route): string
    {
        $pattern = str_replace('/', '\/', $route);

        foreach ($this->getParams() as $param => $type) {
            switch ($type) {
                case 'int':
                case 'integer':
                    $pattern = str_replace("{\$$param}", "(?P<$param>[0-9]+)", $pattern);
                    break;
                case 'float':
                    $pattern = str_replace("{\$$param}", "(?P<$param>[0-9.,]+)", $pattern);
                    break;
                case 'string':
                case 'module':
                case 'controller':
                    $pattern = str_replace(
                        "{\$$param}",
                        "(?P<$param>[a-zA-Z0-9-_.]+)",
                        $pattern
                    );
                    break;
            }
        }
        return '/^' . $pattern . '/i';
    }
protected function prepareRoutePattern ( $ route ) : string { $ pattern = str_replace ( '/' , '\/' , $ route ) ; foreach ( $ this -> getParams ( ) as $ param => $ type ) { switch ( $ type ) { case 'int' : case 'integer' : $ pattern = str_replace ( "{\$$param}" , "(?P<$param>[0-9]+)" , $ pattern ) ; break ; case 'float' : $ pattern = str_replace ( "{\$$param}" , "(?P<$param>[0-9.,]+)" , $ pattern ) ; break ; case 'string' : case 'module' : case 'controller' : $ pattern = str_replace ( "{\$$param}" , "(?P<$param>[a-zA-Z0-9-_.]+)" , $ pattern ) ; break ; } } return '/^' . $ pattern . '/i' ; }
Prepare Route pattern

@param  string $route

@return string
Prepare Route pattern