title: Replace string with part of the matching regex
body: <p>I have a long string. I want to replace all the matches with part of the matching regex (group).</p>
  
  <p>For example:</p>
  
  <pre><code>String = "This is a great day, is it not? If there is something, THIS IS it. &lt;b&gt;is&lt;/b&gt;".
  </code></pre>
  
  <p>I want to replace all the words <code>"is"</code> by, let's say, <code>"&lt;h1&gt;is&lt;/h1&gt;"</code>. The case should remain the same as original. So the final string I want is:</p>
  
  <pre><code>This &lt;h1&gt;is&lt;/h1&gt; a great day, &lt;h1&gt;is&lt;/h1&gt; it not? If there &lt;h1&gt;is&lt;/h1&gt; something, 
  THIS &lt;h1&gt;IS&lt;/h1&gt; it. &lt;b&gt;&lt;h1&gt;is&lt;/h1&gt;&lt;/b&gt;.
  </code></pre>
  
  <p>The regex I was trying:</p>
  
  <pre><code>Pattern pattern = Pattern.compile("[.&gt;, ](is)[.&lt;, ]", Pattern.CASE_INSENSITIVE);
  </code></pre>