title: regex doesn't capture all groups
body: <pre><code>   &lt;name&gt;name for the group&lt;/name&gt;&lt;description&gt;server-description&lt;/description&gt;&lt;resource&gt;10.1.1.1:*&lt;/resource&gt;&lt;resource&gt;10.1.1.2:*&lt;/resource&gt;&lt;resource&gt;10.1.1.3:*&lt;/resource&gt;&lt;apply&gt;selected&lt;/apply&gt;&lt;network-connect-acl&gt;&lt;&lt;name&gt;name2&lt;/name&gt;&lt;description&gt;description2/description&gt;&lt;resource&gt;10.2.2.0/26:*&lt;/resource&gt;&lt;apply&gt;selected&lt;/apply&gt;
  </code></pre>
  
  <p>I have converted an XML file to string as above value and trying to catch multiple occurrences of <code>&lt;resource&gt;ABC&lt;/resource&gt;</code> I have the following regex
  defined in python3</p>
  
  <pre><code>regex = re.compile(r'(&lt;name&gt;.*?&lt;/name&gt;)(.*?)(&lt;resource&gt;.*?&lt;/resource&gt;)+')
  print(regex.findall(string))
  </code></pre>
  
  <p>but instead of catching all three occurrences, it only catches the first one:</p>
  
  <pre><code>('&lt;name&gt;name for the group&lt;/name&gt;', '&lt;description&gt;server-
  description&lt;/description&gt;', '&lt;resource&gt;10.1.1.1:*&lt;/resource&gt;')
  </code></pre>
  
  <p>I would like the regex to catch the string in between  and  tags. If we take the string above as sample, I expect to catch it something like this;</p>
  
  <pre><code>&lt;name&gt;name for the group&lt;/name&gt;&lt;resource&gt;10.1.1.1:*&lt;/resource&gt;&lt;resource&gt;10.1.1.2:*&lt;/resource&gt;&lt;resource&gt;10.1.1.3:*&lt;/resource&gt;&lt;name&gt;name2&lt;/name&gt;&lt;description&gt;description2/description&gt;&lt;resource&gt;10.2.2.0/26:*&lt;/resource&gt;
  </code></pre>
  
  <p>In doing so, I will group "name" element with its associated resource elements so that the first tuple matched by this regex will contain this:</p>
  
  <pre><code>('&lt;name&gt;nameforthegroup&lt;/name&gt;','&lt;resource&gt;10.1.1.1:*&lt;/resource&gt;
  &lt;resource&gt;10.1.1.2:*&lt;/resource&gt;&lt;resource&gt;10.1.1.3:*&lt;/resource&gt;')
  </code></pre>
  
  <p>and second tuple and so fort will be like this</p>
  
  <pre><code>('&lt;name&gt;name2&lt;/name&gt;','&lt;resource&gt;10.2.2.0/26:*&lt;/resource&gt;)
  </code></pre>
  
  <p>The file contains hundreds of records like this but when I run the code I get something like this:</p>
  
  <pre><code>[('&lt;name&gt;nameforthegroup&lt;/name&gt;', '&lt;description&gt;server-description&lt;/description&gt;', '&lt;resource&gt;10.1.1.1:*&lt;/resource&gt;'), ('&lt;name&gt;name2&lt;/name&gt;', '&lt;description&gt;description2/description&gt;', '&lt;resource&gt;10.2.2.0/26:*&lt;/resource&gt;')]
  </code></pre>