i could match content between tr tags with this regex:
<tr\s+class='test'>((?!</tr>).)*</tr>
but if i put the star quantifiers inside the parenthesis right next to the dot metacharacters,they match only the whole pattern with capturing group empty.
$string = "<tr class='test'>
<td>test1</td>
</tr>
<div class='ignored' >text text</div>
<tr class='test'>
<td>test2</td>
</tr>";
preg_match_all("|<tr\s+class='test'>((?!</tr>).*)</tr>|si",$string,$matches);
print_r($matches);
i know what lookaround is but i'm not quite sure what exactly cause the difference. hope someone can shed some light on this. Thank you!