4 ms·
That statement is content-free. Robust parsing can be achieved using regexes as a tool. I want some reasoning better than "ew, regexes!"
by gamache 17y ago
That statement is content-free. Robust parsing can be achieved using regexes as a tool. I want some reasoning better than "ew, regexes!"
- stcredzero 17y agoIf the "regexes" can call each other recursively, then this is possible. If not, then it is theoretically impossible. The proof is often given as a problem in your basic automata class. "Regexes" are no longer the same as "Regular Expressions" in automata theory. But their origin is in automata theory. A lot of the "ew, regexes" reaction comes from this. I'm skeptical that augmented "regexes" are any more maintainable than compiler compilers.
- gamache 17y agoYes, I am talking about using regexes where a "standard" parser would use getc() and switch statements all over the place. You can't just write a clever regex and wrap it in a while loop and have a parser to go; as you mention, this is theoretically impossible.