Cache regular expressions