I've got a text, that contains '<nobr>' and '</nobr>' tags:
<nobr>aaa <nobr>aaa aaa</nobr> aaa</nobr> <nobr>aaa aaa</nobr>
And I need to transform it into this one:
<nobr>aaa aaa aaa</nobr> aaa</nobr> <nobr>aaa aaa</nobr>
Here is my logic:
Find first <nobr> tag, than find second <nobr>. If there is no </nobr> tag between them, delete the second one <nobr>. So I've written this regexp function:
$text = preg_replace ("'(<nobr>.*(?!<\/nobr>))<nobr>'", "\\1", $text);
It doesn't work! Please help!
PS This is only the first part. Finally I would like to get this text:
<nobr>aaa aaa aaa aaa</nobr> <nobr>aaa aaa</nobr>