Regular Expression To Match HTML Tags

A Regular Expression to match all opening and closing HTML tags.

/<[^>]+>/

Matches:

  • <a>
  • </p>
  • <h1></h1>

Non-matches:

  • ABC
  • <a
  • p>

See Also: