I have a table that I am trying to parse
<tr>...</tr>
<tr>...</tr>
<tr>...</tr>
<tr>...</tr>
each row is similarly formatted and I want to split them apart using regular expressions. I have tried everything I can think of but it always seems to take the whole contents as the match
I’ve tried stuff like this
$pattern = ':(<tr>.*</tr>):';
preg_match_all( $pattern , $working, &$regs2 );
but it always maximally takes everything in one go rather than minimally taking it row by row.
This is probably pretty basic but I just can’t seen to get it.
In the regex tester I usually use, it seems to work normally. (http://regexpal.com/)
If it seems like it’s too greedy, try using a ? after the * to calm it down a bit. If you’re not wanting the capture the
<tr></tr>move the () to the inside, like<tr>(.*?)</tr>/