Avoid compiling regex in the parameter converter.

Building a regex can be costly in the fast path. Build it once and reuse it.