PHP class to route with regular expressions. Extremely small.
MIT License
PHP class to route with regular expressions. Extremely small. Follows every conceivable best-practice - SRP, SoC, DI, IoC, bfft...
The only actual code is RegexRouter.php. index.php and the .htaccess file are just demoing usage. The 3 together in a TLD will function.
require_once 'RegexRouter.php';
$router = new RegexRouter();
$router->route('/^\/some\/pattern$/', <closure>);
$router->execute($_SERVER['REQUEST_URI']);