Construct re patterns
Create patterns outside of the closure
Merge pull request #5 from brutasse/feature/cors

Construct re patterns