title: Why does replaceAll fail with "illegal group reference"?
body: <p>I am in need to replace </p>
  
  <pre><code>\\\s+\\$\\$ to $$
  </code></pre>
  
  <p>I used </p>
  
  <pre><code>String s = "  $$";
  s = s.replaceAll("\\s+\\$\\$","$$");
  </code></pre>
  
  <p>but it throws exception</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: Illegal group reference</p>
  </blockquote>