Precompile regex pattern