title: How do you capture and reuse a match with Java regex?
body: <p>I'm trying to remember the correct notation for doing find-replace regex matches in Java. </p>
  
  <p>Say I have the string </p>
  
  <pre><code>    String s = "My name is ''Eric'' and I have a bee called ''Eric'' 
  and a fish called ''Wanda''."
  </code></pre>
  
  <p>I want to do something like the following:</p>
  
  <pre><code>s.replaceAll("\'\'$$\'\'", "$$");
  </code></pre>
  
  <p>To give: <strong>My name is Eric and I have a bee called Eric and a fish called Wanda.</strong></p>
  
  <p>But I know $$ isn't the correct notation to capture whatever is in the '' and use it to replace the found match.</p>
  
  <p>What's the particular notation I'm looking for here?</p>
  
  <p>Thanks in advance.</p>
  
  <p>-Dave.</p>