I have been tinkering with the idea of creating a routing system as a learning experience and not for some production purpose.
I have trying to decide what features are a must have and what features are best handled elsewhere in a system. I have come up with a short list of features and I would like to get some feedback on it. Are there things missing? Or are there anything that is just pure overkill? The list goes a follows:
- Regular expression matching against URI
- Matching HTTP request scheme
- Matching HTTP request method
- Checking if a request is a normal request or an AJAX request.
I have chosen to use regular expressions so that I have the possibility of using capture groups to match a dynamic URI. Regarding the overheat of regular expressions I think the worst can be reduced by producing clever expressions and only matching until a match is found.