There are strings in a long text as:
<fn id="T1FN1"> anytext <p> sometext </p> </fn>
<fn id="T2FN1"> anytext <p> sometext </p> </fn>
<fn id="T2FN2"> anytext <p> sometext </p> </fn>
<fn id="F12FN5"> anytext <p> sometext </p> </fn>
etc…
I want to find
<fn </fn> in a text and delete
<p> and </p>
just from these strings, the string between <p> and </p> would not be deleted. I try some preg_replace, but not successful.
You can try using a nested regex:
Note: this syntax requires PHP 5.3+. If you’re running an older version, let me know and I’ll provide the syntax for that.