Regular expression to get content between tr tags

Hello, please tell me the regular expression for getting the content between the tr/trtags, using preg_match_all, all characters can occur between them, except the above tags, characters an indefinite number (from 1 to infinity).

And if possible, then also if tables can be placed between them (i.e. there can be tr/trtags).


Answer 1, authority 100%

PHP, regular expressions. Extract lines between tags.


Answer 2, authority 50%

Honestly, I’m not good at it, but it seems to me somehow…

if (preg_match('|<tr.*?>(.*)</tr>|sei', $str, $arr)) $tr = $arr[1];
else $tr='';