updated regexes to be more efficient, and to use the matched token in the output