This has been discussed so many times here on SO. See e.g.
Can you provide some examples of why it is hard to parse XML and HTML with a regex?
Why it's not possible to use regex to parse HTML/XML: a formal explanation in layman's terms
Just follow the links on the right side of the screen to more answers.
My conclusion:
Simple, because a regular expression is not a parser, its a tool to find patterns.
If you want to find a very specific pattern in a (ht|x)ml file, go on, regex is perfect for that.
But if you are searching for something in in every Foo tag, that could have attributes in different orders, that can be nested, that can be malformed (and still valid), then use a parser, because thats not pattern matching anymore.