Build, test, and debug regular expressions
This PCRE regex matches the contents of simple HTML or XML tags, ensuring the opening and closing tag names are identical by using a backreference. It captures the tag name in the first group and the inner text content in the second group. Note that this pattern assumes the inner content contains no additional HTML tags (the '<' character) and that attributes in the opening tag do not contain '>'.