On Monday, August 22, 2016 at 12:24:30 AM UTC+5:30, Tim Chase wrote: > 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
A recent thread has some links on this: https://mail.python.org/pipermail/python-list/2016-July/712046.html Some of the responses to that (Ben Bacarisse??) found better links than mine apparently Also ragel is a tour-de-force that exploits this: http://www.colm.net/open-source/ragel/ -- https://mail.python.org/mailman/listinfo/python-list