how often does re.compile compile?

wade at lightlink.com wade at lightlink.com
Mon Sep 6 15:20:08 EDT 1999


Hello,
    I'm a recovering Perl user who's using the re module to parse a
bunch of text. (Miscellaneously tagged.)

Looking at other people's code, I notice folks tend to do their
re.compile()'s at the global level.  I've got one pattern that is used
only within one function. If I say re.compile() inside the function
definition, does the pattern get compiled afresh every time the function
is called?

Thanks --

-- Wade Leftwich





Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




More information about the Python-list mailing list