Perhaps compile this re outside of the function?