Move re.compile out of functions
Moving re.compile out of functions has the potential to speed up re-intensive functions (although re.compile does cache results on its own).
Closes: #971960
Moving re.compile out of functions has the potential to speed up re-intensive functions (although re.compile does cache results on its own).
Closes: #971960