Как ограничить параметры в маршруте?

Делаю свою MVC. Создал обработчик маршрутов с параметрами, но вот проблема. Количество параметров, передаваемых в URI не контролируется и при любом количество исполняется мой маршрут.

Пример этой бесконтрольности -

http://localhost:8000/news/123/435/434545435/5435435/ 
Успешно срабатывает (НЕ ДОЛЖНО)

Пример верной работы -

http://localhost:8000/news/123/435/434545435/5435435/ 
Ничего не выдает так как маршрут не совпал

routes.php

<?php
return array(
    'news/(.+)/' => 'NewsController@view/$1/',
    'news' => 'NewsController@index',
);

Router.php - самый главный файл

<?php


class Router
{
    private $routes;

    /**
     * Router constructor.
     */
    public function __construct()
    {
        $routePath = ROOT.'/App/Components/routes.php';
        $this->routes = require_once($routePath);
    }

    /**
     * @return string
     */
    private function getURI()
    {
        if (!empty($_SERVER['REQUEST_URI'])) {
            return trim($_SERVER['REQUEST_URI'], '/');
        }
    }

    public function run()
    {
        $uri = $this->getURI();
        foreach ($this->routes as $uriPattern => $path) {
            if (preg_match("~$uriPattern~", $uri)) {

                $internalRoute = preg_replace("~$uriPattern~", $path, $uri);

                $segments = Exploder::multiExplode(['/', '@', '(', ')'], $internalRoute);

                $controllerName = array_shift($segments);
                $methodName = array_shift($segments);
                $parameters = $segments;
                $controllerFile = ROOT."/Controllers/".$controllerName.".php";
                if (file_exists($controllerFile)) {
                    require_once($controllerFile);
                }
                $controllerObject = new $controllerName;
//                $result = $controllerObject->$methodName($parameters);
                $result = call_user_func_array(array($controllerObject, $methodName), $parameters);

                if ($result != null) {
                    break;
                }

            }
        }
    }

}

Exploder.php

<?php


class Exploder
{
    final public static function multiExplode($delimiters, $data)
    {
        $MakeReady = str_replace($delimiters, $delimiters[0], $data);
        return explode($delimiters[0], $MakeReady);;
    }

}

Ответы (1 шт):

Автор решения: Alexander Chernykh
'news/([^/]+)$'

Спасибо пользователю @splash58 за решение проблемы

→ Ссылка