Recompiling the regex in every iteration of for loop defeats the purpose of compiling it. ;)
Merge pull request #1 from SecurityForUs/csrf_token_fix

Regex compiling should only be done once