On 2016-08-21 04:53, Rustom Mody wrote: > 2. Basic computing theory shows that re-s and dfas are equivalent. > Which would one prefer to write/debug? [Thats not a rhetorical > question]
I'm curious where REs and DFAs are shown to be equivalent (serious, not trying to be snarky). I can see with no trouble that all REs are DFAs, but can't convince myself that *all* DFAs are REs. Though this might also depend on the RE engine. Do you have links to resources on such an "all REs have equivalent DFAs and all DFAs have equivalent REs" logic/argument? Or maybe my understanding of DFAs is flawed. And as for which I prefer to write, for simple text-processing that doesn't involve nesting, I generally prefer REs; but for more complex processing, a custom DFA tends to expand a bit more cleanly in my experience. -tkc -- https://mail.python.org/mailman/listinfo/python-list