"TP" == Tim Peters
writes:
TP> Over the long run, moving to a DFA locks Python out of the TP> directions Perl is *moving*, namely embedding all sorts of TP> runtime gimmicks in regexps that exploit knowing the "state of TP> the match so far". DFAs don't work that way. I don't mind TP> losing those possibilities, because I think the regexp TP> sublanguage is strained beyond its limits already. But that's TP> a decision with Big Consequences, so deserves some thought. I know zip about the internals of the various regexp package. But as far as the Python level interface, would it be feasible to support both as underlying regexp engines underneath re.py? The idea would be that you'd add an extra flag (re.PERL / re.TCL ? re.DFA / re.NFA ? re.POSIX / re.USEFUL ? :-) that would select the engine and compiler. Then all the rest of the magic happens behind the scenes, with appropriate exceptions thrown if there are syntax mismatches in the regexp that can't be worked around by preprocessors, etc. Or would that be more confusing than yet another different regexp module? -Barry