$text
contains some text with multiple tags. How to find all the strings in $ text:
<тег class="black" тут его остальные свойства>тут содержимое тега</тег>
and replace with the contents of the tag with a newline, and write to another variable? For example:
<div class="black" id="left">левый блок</div>
to change to:
левый блок
In general, tags, contents of tags, properties, except for class, can be different.