/**
* Extract routes matching current route from all known routes.
*
* @return \Joomla\Router\Route[]
*
* @since 4.0.0
*/
public function getMatchingRoutes()
{
$routePath = $this->getRoutePath();
// Extract routes matching $routePath from all known routes.
return array_filter($this->routes, function ($route) use($routePath) {
return preg_match($route->getRegex(), ltrim($routePath, '/')) === 1;
});
}