|
From: <bc...@wo...> - 2001-03-20 16:57:59
|
[Steven Marcus] >The re.py module gives preference to the new sre module. >However, I notice that the java version of the re module is >implemented using the ORO matcher -- Right. >and I assume that the java >version is used instead of the py version in jython. No. In general we have two regular expression engines in jython: "pre" and "sre", where "pre" is the ORO implementation and "sre" is a port of Fredrik Lundh's unicode aware engine. The "re" module can map to either one of these and by default it maps to "sre". Technically the "sre" engine is doing its compilation in python and the actual matching is implemented in the "_sre" java module. >I am a heavy user of regex in jython. What is the future? sre. Mainly because it is 100% feature compatible with CPython. >Will the java version of the re module go away and the ORO >matcher be eliminated? Maybe. As long as there is no technical advantages for removing it, it will stay. >Will I have to continue to explicitly >import sre to use the python-based regex code? ? You don't have to import "sre" now. Importing "re" will do. >Has anyone done any performance comparisons of sre v. ORO? Not me. If you manage to create some real life timing numbers, please post them. regards, finn |