balanced string matching, and replacing.