re.search much slower then grep on some regular expressions

Terry Reedy tjreedy at udel.edu
Sun Jul 6 21:58:43 CEST 2008



Sebastian "lunar" Wiesner wrote:

> I completely agree.  I'd just believe, that the combination of some finite
> state machine for "classic" expressions with some backtracking code is
> terribly hard to implement.  But I'm not an expert in this, probably some
> libraries out there already do this.  In this case, it'd be time to give
> pythons re engine a more sophisticated implementation ;)

One thing to remember in making comparisons is that Python moved to its 
own implementation to support unicode as well as extended ascii (bytes 
in 3.0).  Does grep do that?  Has pcre, which Python once used, been 
upgraded to do that?




More information about the Python-list mailing list