title: Regex non-capturing group is capturing
body: <p>I have this regex </p>
  
  <pre><code>(?:\&lt;a[^*]href="(http://[^"]+?|[^"]+?\.pdf)"+?[^&gt;]*?)&gt;
  </code></pre>
  
  <p>The point of this regex is to capture every closing tag ('>') of an anchor that has an href that starts with "http://" or ends with ".pdf".</p>
  
  <p>The regex works, however it is capturing the first part of the anchor, which I absolutely need to NOT capture.</p>
  
  <p>In the following samples all are matching except second (which is fine) but only the last bracket should be captured and it is not the case.</p>
  
  <pre><code>&lt;a href="http://blabla"&gt;omg&lt;/a&gt;
  &lt;a href="blabla"&gt;omg&lt;/a&gt;
  &lt;a href="http://blabla.pdf"&gt;omg&lt;/a&gt;
  &lt;a href="/blabla.pdf"&gt;omg&lt;/a&gt;
  </code></pre>
  
  <p>For example: If we take the first match which is :</p>
  
  <pre><code>&lt;a href="http://blabla"&gt;
  </code></pre>
  
  <p>I only want to capture the last bracket (the one I surounded with parenthesis) :</p>
  
  <pre><code>&lt;a href="http://blabla"(&gt;)
  </code></pre>
  
  <p>So why the non-capturing group is capturing? And how can I only grab the last bracket of the anchor</p>
  
  <p>Even if I streamline my regex to the following, it still doesnt work</p>
  
  <pre><code>(?:\&lt;a[^*]href="http://[^"]+"+[^&gt;]*)(&gt;)
  </code></pre>
  
  <p>Thank you,</p>