title: Number of regex matches
body: <p>I'm using the <code>finditer</code> function in the <code>re</code> module to match some things and everything is working. </p>
  
  <p>Now I need to find out how many matches I've got. Is it possible without looping through the iterator twice? (one to find out the count and then the real iteration)</p>
  
  <p>Some code:</p>
  
  <pre><code>imageMatches = re.finditer("&lt;img src\=\"(?P&lt;path&gt;[-/\w\.]+)\"", response[2])
  # &lt;Here I need to get the number of matches&gt;
  for imageMatch in imageMatches:
      doStuff
  </code></pre>
  
  <p>Everything works, I just need to get the number of matches before the loop.</p>