Precompiling regex expressions from configuration if present and caching them.