optimize expressions by compiling regexes on instance creation