Quote:
Originally Posted by 1v4n0
How about a regex that finds everything that has the structure of
<AAAwhatever></AAA>
i.e. all empty html elements.
Or, even better, all elements that either are empty or that contain just a space.
|
i use something like this to catch paragraph tags, either empty or containing only whitespace. it also catches nested tags, so things like
<p><i><b><br/></b></i></p>
Code:
(?s)<p[^>]*?>\s*?(?:<\w[^>/]*?>)*?\s*?(?: |*|<br(?:\s|\s/|/)?>)*?\s*?(?:</\w[^>/]*?>)*?\s*?</p>
Quote:
Originally Posted by 1v4n0
EDIT Looks like this one is working, though I'm not entirely sure why.
Code:
<[^/>]+>[ \n\r\t]*</[^>]+>
|
because it's looking for
an opening and closing bracket containing one or more of anything except closing brackets or forward slashes
followed by none or more spaces, newlines or tabs
followed by an opening and closing bracket containing one or more of anything except closing brackets or forward slashes