Regex: Capturing Group that does not contain regex : <pre><code>&lt;DIV&gt;&lt;SPAN CLASS="dt23 ll0"&gt;A suggestion: for the &lt;SPAN CLASS="jl2"&gt;quickest&lt;/SPAN&gt; overview of &lt;SPAN CLASS="jl2"&gt;Mark&lt;/SPAN&gt;, first read all the Division titles (I, II, III, etc.), then come back and read &lt;/SPAN&gt;&lt;/DIV&gt;
    &lt;DIV&gt;&lt;SPAN CLASS="dt24 ll0"&gt;the individual outline titles. &lt;/SPAN&gt;&lt;/DIV&gt;
    &lt;DIV&gt;&lt;SPAN CLASS="dt25 ll2"&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;/DIV&gt;
    &lt;DIV&gt;&lt;SPAN CLASS="dt26 ll2"&gt; &lt;/SPAN&gt;&lt;/DIV&gt;
    &lt;DIV&gt;&lt;SPAN CLASS="dt27 ll2"&gt; &lt;/SPAN&gt;&lt;/DIV&gt;
    &lt;DIV&gt;&lt;SPAN CLASS="jl4"&gt;UTLINE OF &lt;/SPAN&gt;M&lt;SPAN CLASS="jl4"&gt;ARK&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/DIV&gt;
    &lt;DIV&gt;&lt;SPAN CLASS="dt29 ll2"&gt; &lt;/SPAN&gt;&lt;/DIV&gt;
    &lt;DIV&gt;&lt;SPAN CLASS="dt30 ll2"&gt; &lt;/SPAN&gt;&lt;/DIV&gt;
</code></pre>

<p>I'm trying to retrieve entire SPAN elements here without capturing another SPAN's open tag. This regex here clearly fails</p>

<pre><code>&lt;SPAN.*?&gt;(.*?)&lt;\/SPAN&gt;
</code></pre>

<p>An example result of the regex above is this:</p>

<pre><code>&lt;SPAN CLASS="ps23 ft0"&gt;A suggestion: for the &lt;SPAN CLASS="em2"&gt;quickest&lt;/SPAN&gt;
</code></pre>

<p>Which is undesirable. The regex that I've coded so far to achieve this is this:</p>

<pre><code>&lt;SPAN.*?&gt;(.*?(?!&lt;SPAN&gt;.*?).)&lt;\/SPAN&gt;
</code></pre>

<p>And miserably fails</p>
