Created internal data structure for storing stuff like the compiled regular expression.
Fixed crash when running regex