Could you make the compiled regex constants at the module level ?
This way they would get compiled only once which is a good practice as regex compiling is a bit CPU consuming.