Allocates only enough memory to generate regex results.