move regex

building the regex outside of the function that'll be called in the match loop.

would be cool to see if this is an actual improvement in speed.