Hacker News new | ask | show | jobs
by encryptluks2 1183 days ago
Unfortunately regex is the best we have. A bunch of if statements is also a whole less efficient and prone to errors than a regex statement. Once you start to learn regex, it actually isn't that bad. The challenging part is that a lot of people cut and paste not really understanding it and you end up with a bunch of bad regex examples.
1 comments

Eh, I think the challenging part is understanding a complex regex that's already been written. You really do need good comments and unit tests to go along with a regex in order to understand the intent, otherwise they rapidly become unmaintainable.