handle regexes correctly in formatting
Merge pull request #1277 from Microsoft/formatting_regexes

handle regexes correctly in formatting