protected function getPattern(): string
    {
        $path = preg_replace_callback('~:([a-z][a-z0-9\_]+)~i', function ($match) {
            return sprintf('(?<%s>%s)', $match[1], '[^\/]*');
        }, $this->getPath());

        return sprintf('~\G(%s)(/|\z)~', $path);
    }
protected function getPattern(): string
    {
        $path = preg_replace_callback('~:([a-z][a-z0-9\_]+)~i', function ($match) {
            return sprintf('(?<%s>%s)', $match[1], '[^\/]*');
        }, $this->getPath());

        return sprintf('~\G(%s)(/|\z)~', $path);
    }
protected function getPattern ( ) : string { $ path = preg_replace_callback ( '~:([a-z][a-z0-9\_]+)~i' , function ( $ match ) { return sprintf ( '(?<%s>%s)' , $ match [ 1 ] , '[^\/]*' ) ; } , $ this -> getPath ( ) ) ; return sprintf ( '~\G(%s)(/|\z)~' , $ path ) ; }
Get pattern to match request path.

@return string
Get pattern to match request path .