Factor out the creation of the Test::Regexp object.

Just to save a lot of repeatative code.