REGEX – Find unclosed img tags

As you probably know, the xhtml standard requires all tags to be properly closed.

This regular expression will search for unclosed img tags. It could be easily modified to grab any other unclosed html tags.
view source


<img([^>]+)(\s*[^\/])>

Leave a Reply

Your email address will not be published. Required fields are marked *

*