Generate string from regular expression