3 ms·
Yes and editor search is one of the few reasons to use regex these days. If you're writing something more permanent then you should use a real parser library!
by chongli 4y ago
Yes and editor search is one of the few reasons to use regex these days. If you're writing something more permanent then you should use a real parser library!
- nlitened 4y agoAdd a new library dependency when built-in one-liner regex does just fine? I don’t think that’s a good idea by any measure. Also, learning regex syntax has much better ROI and is a much more transferable skill, than learning a specific parser library’s syntax and bugs. Just invest 30 minutes once in your life into learning basic regex, for Christ’s sake, it’s not that hard!
- nerdponx 4y agoOr use a 21st-century language that has a parser framework in the standard library ;) Of course you can't always use a 3rd-party library, but IMO it should be your default choice without additional constraints. Much like how a memory-safe garbage-collected language should be your default choice for most things.