Test, validate and match regular expressions
Matches HTML or XML elements with their opening tags, content, and closing tags. Uses named capture groups to extract the tag name and content, ensuring the closing tag matches the opening tag. The global flag enables finding multiple elements in the same string.