Allow ability to set regexps explicitly.
Helps with performance in apps that repeatedly call these methods.