I'm trying to remove all empty <p> tags CKEditor is inserting in to a description box but they all seem to vary. The possibilities seem to be:
<p></p>
<p>(WHITESPACE)</p>
<p> </p>
<p><br /></p>
<p>(NEWLINE) </p>
<p>(NEWLINE)<br /><br />(NEWLINE) </p>
With these possibilities, there could be any amount of whitespace, and <br /> tags in between the paragraphs, and there could be some of each kind in one paragraph.
I'm also not sure about the <br /> tag, from what I've seen it could be <br />, <br/> or <br>.
I've searched SO for a similar answer but of all the answers I've seen they all seem to cater for just one of these cases, not all at once. I guess in simple terms what I'm asking is, Is there a regular expression I can use to remove all <p> tags from some HTML that don't have any alphanumeric text or symbols/punctuation in them?