all. I have regexp and it working in test site, but didn't work in PHP. https://regex101.com/r/jZ5gA3/3 - regex template and test.
PHP:
$re = "/.*?<tr>.*?<\/tr>.*?(<tr>).*?<\/tr>.*?/sgi";
$subst = "<tr style=\"backgroud: $color;\">";
$text = preg_replace( $re, $subst, $text );
Input data not change. So, please explain me, why on regex101 find needle data and didn't find in PHP code. Thanks.