precompile regex once