title: Reg Replace text block first occurrence + last occurrence
body: <p>Just a little question.</p>
  
  <p>I have to quote a text inside a couple of string taking the first occurrence of one and the last occurrence of other.</p>
  
  <p>Ex.</p>
  
  <pre><code>[quote]
  Hi to all
  [quote]
  im fine
  [/quote]
  [/quote]
  </code></pre>
  
  <p>I hate to inscribe all the quoted text inside a DIV. So I have a regexp like:</p>
  
  <pre><code>String pattern = "\\[quote\\](.*?)\\[\\\quote\\\]";
  body = body.replaceAll(pattern, "&lt;div class=\"quote\"&gt;[quote]$1[/quote]&lt;/div&gt;"); 
  </code></pre>
  
  <p>It works but the regexp take from first [quote] to first [/quote] leaving the second [/quote] outside the DIV. What I want obtain is:</p>
  
  <pre><code>&lt;div class="quote"&gt;
  [quote]
  Hi to all
  [quote]
  im fine
  [/quote]
  [/quote]
  &lt;/div&gt;
  </code></pre>
  
  <p>Thanks.</p>