Agreed that it shouldn't be instantiated anew every time, but I think it'd be better to just memoize the Regexp. Accomplishes the same goal, but keeps the original interface (doesn't require caller to know about the Regexp, and how to build it).