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.
Merge pull request #2 from doowb/move-regex-building

move regex