faster code (by caching regex in object)