XML like expressions (infinintely recursive tags) is not a 'regular language' therefore cannot be parsed with regular expressions (regex). Here's why:
http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/
http://www.perlmonks.org/?node_id=668353
http://stackoverflow.com/questions/1379524/textual-protocol-which-is-not-a-regular-languagehttps://stackoverflow.com/questions/1379524/textual-protocol-which-is-not-a-regular-language