Test, validate and match regular expressions
This regular expression matches an entire line containing a single HTML or XML tag, supporting both paired elements and self-closing tags. It captures the tag name in the first alternative to ensure that the closing tag correctly matches the corresponding opening tag. It is useful for validating markup structure, extracting specific block-level elements, or parsing simple configuration files formatted with tags.