Optimization: compile regexes