title: How to use Matcher.quoteReplacement with appendTail for strings having $ as literal
body: <p>I have a String like </p>
  
  <blockquote>
    <p>Hello $1 abc $1 $2 $3<br>
       Hello $1 abc $1 $2 $3<br>
       Hello $1 abc $1 $2 $3</p>
  </blockquote>
  
  <p>If i want to search for <strong>"Hello .*? abc"</strong> and replace it with something,
  i was using <strong>matcher.appendReplacement(sb, Matcher.quoteReplacement(s));</strong> But, how do i use the same with appendTail() method?</p>
  
  <pre><code>Pattern p = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE+Pattern.DOTALL );
  Matcher m = p.matcher(str);
  String sub;
  StringBuffer sb = new StringBuffer();
  while(m.find()){
      String s = m.group();   
      s = s.replaceAll(replaceTagpattern, replaceWithTagpattern);
      m.appendReplacement(sb, Matcher.quoteReplacement(s));
  }
  m.appendTail(sb);
  </code></pre>
  
  <p>Edit:</p>
  
  <p>Expected output:</p>
  
  <blockquote>
    <p>something $1 $2 $3<br>
       something $1 $2 $3<br>
       something $1 $2 $3</p>
  </blockquote>