HTML Tag

Matches a valid HTML tag.

Contributed by @itsbrunodev

regex
<(?<tag>[a-z]+)(?<attribute>\s+[a-z-]+="[^"]*")*\s*>(?<content>.*?)<\/\1>
html
<!-- Valid HTML Tags -->
<div>Content</div>
<a href="#">Link</a>

Keywords

html
tag