Caches compilation of regexes.