I created the regexp using the XML-specificaton (https://www.w3.org/TR/xml), but in a simplified format (for example allowing only a narrowed set of tag-name characters). The regular expression is a recursive regexp with backreference. I do not tested extensively the regex with a regex-directed engine, so it is not optimized for that. I used the regexp to check a text-directed regular expression engine developed by me ( Windows-users can test this engine, visit https://www.regex.hu )