2 ms·
The worst part is that as soon as he mentioned regular expressions I knew exactly what the problem was. Regexes are powerful and useful but also dangerous. Pe
by jandrese 11y ago
The worst part is that as soon as he mentioned regular expressions I knew exactly what the problem was.
Regexes are powerful and useful but also dangerous. People who don't thoroughly understand them and try to get fancy often run into problems like this. In general you shouldn't be using them to parse a computer language anyway, it is something you should be using a tokenizer/parser for.
- emodendroket 11y agoWell, when the only tool you have is a hammer...
- kuschku 11y agoIf something can be done with regex, someone will do it with regex, and it will end up in a big project. That’s why I weeped when support for named groups and backmatching was added.
- jerguismi 11y agoHmm, if I remember right, on our compiler course we wre taught to build tokenizer with regexpes. As far as I unrestand, it is quite valid tool for that.