code: protected function getPathMatcherForRoute(Route $route) : string
      {
          $pathMatcher = preg_replace('#\[:(.+?)\]#i', '(?P<$1>[^/]+?)/?', $route->getPath());
          return sprintf('#^%s$#i', $pathMatcher);
      }
docs: {@inheritdoc}