3 ms·
> (famously) there is no regex to detect balanced parentheses God, I remember running into this wall with an in-company domain-specific language that used rege
by lioeters 7y ago
> (famously) there is no regex to detect balanced parentheses
God, I remember running into this wall with an in-company domain-specific language that used regex as its tokenizer/parser.
Adding support for nested structures required us to untangle the whole thing and rewrite the regex into explicit algorithms. Fortunately the regex was only a few pages long..
In short, I agree with you that regex cannot parse regular expressions completely. Would be happy to be proven wrong, though!
- blibble 7y ago> In short, I agree with you that regex cannot parse regular expressions completely. Would be happy to be proven wrong, though! the proof that you can't parse nested pararetheses with a regular language is a pretty standard part of first year computer science
- lioeters 7y agoIt doesn't stop some of us from trying though! :)