caching regex results