Ah cool thanks Bompa,
I thought ? meant that the group or sign in front of ? can only occur once.
So what if I whant everything in before the third </div> tag ?
Is it /<div(.*){3}</div>/s

The ? does mean 0 or 1 times when it is used as a quantifier.
Anyways, you said "selected sites", so you will know what type of html that
you have to deal with.
The way I usually deal with this situation is with a while loop.
$string =<<"here";
<div id1="content">
<p>blabla content bla</p>
</div>
<div id2="nextcontainer>
<p>blabla</p>
</div>
<div id3="nextcontainer>
<p>blabla</p>
</div>
<div id4="nextcontainer>
<p>blabla</p>
</div>
here
while($string =~ /<div(.*?)<\/div>/sg) {
++$divcounter;
if($divcounter == 2) { print "$1\n"; }
}
This prints the 3rd div cuz the counting starts at zero.
The g modifier needs to be there at the end of the regex.
good luck,
Bompa