added support for writing regexes.