in reply to How to find XML tags using regular expression

That is not even remotely like valid XML, but anyway...

You can try this (ignoring CDATA sections, but including other weird stuff, like the XML declaration):

@tags = grep defined, $xml =~ /<!--.*?-->|(<(?>[^"'>]+|'[^']*'|"[^"]*" +)*>)/sg;
And of course, you'll have some cleaning up to do now, because the output is very coarse.

As a first step into parsing this content, you can use the above regexp in split:

@tokens = split /<!--.*?-->|(<(?>[^"'>]+|'[^']*'|"[^"]*")*>)/s, $xml;
which will return a list of text and tags. Comments will be thrown away.