issue with use of Matcher#appendReplacement(StringBuffer, String)

The second argument is assumed to have special characters \ and $ for use with replacements.  Avoid this by replacing empty string and appending literal on to buffer ourselves.