3 ms·
To everybody hating on regexes: remember that the alternative to even a simple regex is typically a poorly-implemented ad-hoc state machine dozens of lines long
by MrPatan 11y ago
To everybody hating on regexes: remember that the alternative to even a simple regex is typically a poorly-implemented ad-hoc state machine dozens of lines long full of nested loops and conditionals. Without gotos if you're lucky.
_That_ is a bug breeding ground.
Now, if what you are after are regular expressions with a different syntax.... well, maybe you're onto something here.
But I would still call it a regex, personally.
- sklogic 11y agoNo, an alternative to the write-only regexps is nice, clean, dense but yet readable BNF or PEG syntax. And no, they're not regular expressions with a different syntax, they're much higher up in the Chomsky hierarchy.
- dragonwriter 11y ago> To everybody hating on regexes: remember that the alternative to even a simple regex is typically a poorly-implemented ad-hoc state machine dozens of lines long full of nested loops and conditionals. That's an alternative. Its not the only alternative. Monadic Parser Combinators are a thing, after all.