I want to do the following using preg_replace:
$text = "
Lorem ipsum dolor sit amet
***consectetuer adipiscing elit
Aenean commodo ligula eget dolor
Aenean massa
"
$regex = "#('\***')(.*?)
#";
$text = preg_replace($regex1,"<h5>$2</h5>", $text);
And than the output:
Lorem ipsum dolor sit amet
<h5>consectetuer adipiscing elit</h5>
Aenean commodo ligula eget dolor
Aenean massa
So replace the three * with an opening H5 and than the first line break after the three * replace with the closing H5.
I tried many regex patterns, but with no success. As I'm not familiar with this I hope someone can help me?