HTML Markup Regular Expression

A regular expression that matches HTML markup.

/<(\w+)[^>]*>(.*?<\/\1>)?/

HTML Markup Examples:

  • <div class=”demo”></div>
  • <br>
  • <input type=”tel”>

See Also: