Fix regexes for efficiency.