re: What’s an unpopular software opinion you have? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: And yes, the modern URL routers usually use regular expressions and fancy stuff to make URLs pretty. While it does make it slower, a lot of these s...
 

True, but the best routers should compile those regexps to have near zero overhead ✌🏾

Sure, for example:

Basically you turn the regexp into a cached internal object that has very little overhead during the pattern matching.

That's neat. Thanks! I didn't know you could do that. :D

It's very useful if you have to match a regexp in a loop for example. You only construct it once :)

code of conduct - report abuse