I am considering building a web server which routes requests by matching the url to a regex from a list of services that define a regEx property - the first service to match the url handles the request.
I am looking for advice. Has anyone done anything like this? Does using regexs like this sound like a bad idea? If so, what are the possible side effects?
Yes it is a little bad idea. You do not need to reinvent the wheel. For a web server, you will have probably basic requests, /users/all/phones or /items/cool/ascending/top10.. and you will not need advanced regular expressions. Even if you need, a good library Express handles them too. Have a look at ExpressJS Routing, it is already set and probably optimized, so you will not need to hassle with your own routing code.