Number of regex matches
<p>I'm using the finditer-function in the re 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>Edit:
As requested, 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>
