Regex Speed

garrickp at gmail.com garrickp at gmail.com
Wed Feb 21 12:34:45 EST 2007


On Feb 20, 6:14 pm, Pop User <popu... at christest2.dc.k12us.com> wrote:

> Its very hard to beat grep depending on the nature of the regex you are
> searching using. The regex engines in python/perl/php/ruby have traded
> the speed of grep/awk for the ability to do more complex searches.
>
> http://swtch.com/~rsc/regexp/regexp1.html

Some darned good reading. And it explains what happened fairly well.
Thanks!

> > And python 2.5.2.
>
> 2.5.2? Who needs crystal balls when you've got a time machine? Or did
> you mean 2.5? Or 1.5.2 -- say it ain't so, Joe!

2.5. I'm not entirely sure where I got that extra 2. I blame Monday.

In short... avoid using re as a sledgehammer against every problem. I
had a feeling that would be the case.




More information about the Python-list mailing list