Regex speed

Reinhold Birkenfeld reinhold-birkenfeld-nospam at
Sat Oct 30 18:03:48 CEST 2004

Erik Heneryd wrote:
> Reinhold Birkenfeld wrote:
>> OK, thank you. I now got rid of all the regexes, and - surprise,
>> surprise - the speeds are almost equal. The bitter thing about it is
>> that there are now twelve LOC more in Python that don't make
>> understanding the code easier.
> If your problem is that the re.compile() setup takes too long (compared 
> to the time taken to do the actual matching/replacing), my guess is that 
> you don't operate on that much data.  And if that's the case, does it 
> really matter if it's a fraction of a second slower?

My data file is 6 MB in size, I don't think that to be too little.


[Windows ist wie] die Bahn: Man muss sich um nichts kuemmern, zahlt fuer
jede Kleinigkeit einen Aufpreis, der Service ist mies, Fremde koennen
jederzeit einsteigen, es ist unflexibel und zu allen anderen Verkehrs-
mitteln inkompatibel.               -- Florian Diesch in dcoulm

More information about the Python-list mailing list