Regex · HTML tag · Free
HTML tag regex.
Matches an opening or closing HTML tag, including attributes. Copy the pattern below, see what it matches, then tweak it for your exact case with the free generator.
The pattern
/<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s[^<>]*)?>/g
✓ Matches
<div></span><a href="x">✗ Doesn't match
< div>plain texta < bNeed a variation? Generate one
Other common patterns
Parsing and pattern-matching are everywhere in AI systems. MindloomHQ teaches you to build them for real — agents, RAG, pipelines — with projects and certificates.
Explore MindloomHQ →