Due to the oldish answers on this question I think it would be a pretty good idea to mention some more up-to-date solutions to the case in the OP.
The 2 solutions which came to my mind as soon as I saw your question ware:
- FastRoute https://github.com/nikic/FastRoute - Written by Nikita Popov
- Phroute https://github.com/mrjgreen/phroute - Written by Joe Green
Phroute is built on top of FastRoute, hence they both require PHP 5.4.
If you need a PHP 5.3+ solution, I would definitely recommend Slim Framework's routing. If you don't want any of the other functionality which come with the framework, you might extract the Routing parts and use only them (SLIM is MIT licensed, so you are allowed to do whatever)
Ive used the slim routing standalone, in a project of mine - DaGhostman\CodeWave @ github, see tags <=2.4, the relative parts are in Application\Core
& Application\Controller
.