I am making a regex expression in which I only want to match wrong tags like: *some text here, some other tags may be here as well but no ending \'p\' tag* &
*some text here, some other tags may be here as well but no ending \'p\' tag* &
Regex is not always a good choice for xml/html type data. In particular, attributes, case-sensitivity, comments, etc all have a big impact.
For xhtml, I'd use XmlDocument/XDocument and an xpath query.
XmlDocument
XDocument
For "non-x" html, I'd look at the HTML Agility Pack and the same.