regex over files

Skip Montanaro skip at pobox.com
Thu Apr 28 10:07:54 EDT 2005


    Bengt> To be fairer, I think you'd want to hoist the re compilation out
    Bengt> of the loop.

The re module compiles and caches regular expressions, so I doubt it would
affect the runtime of either version.

    Bengt> But also to be fairer, maybe include the overhead of splitting
    Bengt> correctly, at least for the simple case regex in my example -- or
    Bengt> is a you-goofed post for me in the usenet forwarding queues
    Bengt> somewhere still? ;-)

I was just too lazy to incorporate (something like) your change.  You will
note that I was also lazy enough to simply steal your XXXXX file. <wink>

Skip



More information about the Python-list mailing list