Is there a Pythonic 'standard' for how regular expressions should be used?
What I typically do is perform a bunch of re.compile statements at the top of my module and store the objects in global variables... then later on use them within my functions and classes.
I could define the regexs within the functions I would be using them, but then they would be recompiled every time.
Or, I could forgo re.compile completely, but if I am using the same regex many times it seems like recompiling would incur unnecessary overhead.