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