Pre-compiling regex