Re:Is there a regular expression to detect a valid regular e...
by blibble on Sunday September 08, 2019 @05:06PM
(#20913419)
> 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
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!