Parsing string to construct regular expression object.