title: How to make a non-greedy regex for following?
body: <p>I have something like this:
  ...</p>
  
  <pre><code>&lt;div class="viewport viewport_h" style = "overflow: hidden;" &gt;
      &lt;div id="THIS" class="overview overview_h"&gt;
          &lt;ul&gt;
                   &lt;li&gt;some txt to be captured&lt;/li&gt;
                   &lt;li&gt;some txt to be captured&lt;/li&gt;
                   &lt;li&gt;some txt to be captured&lt;/li&gt;
          &lt;/ul&gt;
          &lt;div&gt;
              " some text to be captured"
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  "some text not to be captured"
  &lt;/div&gt;
  &lt;div class="scrollbar_h"&gt;
  &lt;div class="track_h"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>...</p>
  
  <p>I want to capture everything inside <code>div</code> with <code>id=THIS</code>. I'm using somthing like:</p>
  
  <pre><code>@&lt;div class="viewport viewport_h" style = "overflow: hidden;" &gt;\s*&lt;div class="overview overview_h"&gt;\s*(?:&lt;ul&gt;)?([\s\d\w&lt;&gt;\/()="-:;‘’!,:]+)(?:&lt;/div&gt;)+?@
  </code></pre>
  
  <p>The last <code>(?:&lt;/div&gt;)+?</code> is to make it non-greedy for further "&lt;/div>" but that doesn't work and captuers all other following <code>&lt;/div&gt;</code>. :(</p>