Compile a single regex once
Merge pull request #4 from andrewjpage/master

create a single regex