Increase performance by caching preg_match_all results