Proof that RegEx should not be used for HTML parsing and that an XML parser should be used instead
The general consensus is never use RegEx for HTML parsing; an XML parser should be used instead.  

Is there any commendable papers/theses out there which states/prove this?


----------


After reading [this answer](http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags#answer-1732454) to the ["RegEx match open tags except XHTML self-contained tags"](http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags) question and the subsequent ['Parsing Html The Cthulhu Way'](http://www.codinghorror.com/blog/2009/11/parsing-html-the-cthulhu-way.html) blog post by Jeff Atwood, I am a bit annoyed that the head of our Computer Science department taught us 2/3 modules on parsing HTML with RegEx. I'm looking for something I can approach the department with so we can 'save the children'. I don't think they'd change course content based on a blog/SO post. It would be real nice if the documentation proves that an XML parser is the way forward also.
Proof that RegEx should not be used for HTML parsing and that an XML parser should be used instead
===

The general consensus is never use RegEx for HTML parsing; an XML parser should be used instead.  

Is there any commendable papers/theses out there which states/prove this?


----------


After reading [this answer](http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags#answer-1732454) to the ["RegEx match open tags except XHTML self-contained tags"](http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags) question and the subsequent ['Parsing Html The Cthulhu Way'](http://www.codinghorror.com/blog/2009/11/parsing-html-the-cthulhu-way.html) blog post by Jeff Atwood, I am a bit annoyed that the head of our Computer Science department taught us 2/3 modules on parsing HTML with RegEx. I'm looking for something I can approach the department with so we can 'save the children'. I don't think they'd change course content based on a blog/SO post. It would be real nice if the documentation proves that an XML parser is the way forward also.