3 ms·
> Things quickly get out of hand once you have a more complex problem like recognising a valid URL I'm not sure it's so complex. What's the equivalent code fo
by Zababa 5y ago
> Things quickly get out of hand once you have a more complex problem like recognising a valid URL
I'm not sure it's so complex. What's the equivalent code for recognising an URL? Regex are implemented in many languages, so this regex is, in a way, a portable library/function in most programming languages. And since it's shared, it can easily be checked way more than any single library would be.
- jimsimmons 5y agoPortability is an orthogonal concern. I agree with you that it's the reason regexes are the way they are but we could have also had better cross platform APIs.
- Zababa 5y agoRegexes are still better than cross platform APIs, they're an abstract concept. Just like you can implement a tree or a graph in any language and transfer your "tree skills" or your "graph skills", you can do so with regexes.