title: RegEx for parsing repeated groups
body: <p>The source string contain tags like this:  </p>
  
  <pre><code>&gt;&gt;&gt;tagA
  contents 1
  &lt;&lt;&lt;tagA
  ...
  &gt;&gt;&gt;tagB
  contents 2
  &lt;&lt;&lt;tagB
  ...
  </code></pre>
  
  <p>I need to extract tag names and contents inside them. This is what I've got but still not working:</p>
  
  <pre><code>(?&lt;=(&gt;&gt;&gt;(?&lt;tagName&gt;.+)$))(?&lt;contents2&gt;.*?)(?=(&lt;&lt;&lt;.+)$)
  </code></pre>
  
  <p>It <a href="http://regexstorm.net/tester?p=%28%3F%3C%3D%28%3E%3E%3E%28%3F%3CtagName%3E.%2B%29%24%29%29%28%3F%3Ccontents%3E.*%3F%29%28%3F%3D%28%3C%3C%3C.%2B%29%24%29&amp;i=%3E%3E%3EtagA%0D%0Acontents%201%0D%0A%3C%3C%3CtagA%0D%0A...%0D%0A%3E%3E%3EtagB%0D%0Acontents%202%0D%0A%3C%3C%3CtagB%0D%0A...&amp;o=sm" rel="nofollow noreferrer">results</a> to two matches but the tagName in the second match captured multiple lines: </p>
  
  <pre><code>tagA 
  contents 1 
  &lt;&lt;&lt;tagA
  </code></pre>
  
  <p>What am I doing wrong?</p>