class MyRECache(object):

    def __init__(self):
        self.cache = {}

def compile(self, regex_string):
    if regex_string not in self.cache:
        pass
Pythonic and efficient way of defining multiple regexes for use over many iterations