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);
    }