c# - How to remove named HTML Tags and Contents from a String? -


I have tried to understand some examples, here are questions, so I apologize if it seems to me a duplicate But I can not find a regular expression, which I can understand.
I have some HTML to use an XML parser - but I & lt; Head & gt; & Lt; / Head & gt; The tag from this material is generally valid as the rest for normal XML parsing. Tag & lt; Head & gt; From & lt; / Head & gt; Should be removed and their content is so that external HTML is not affected & lt; Body & gt; Tags and more This is a section with HTML tags that I want to be removed for reference:

   & Lt; Meta name = "description" content = "notification" /> & Lt; Base target = "_ head" & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt ;! - Body here - & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

I need to drop the docotype, if it can be done using a RegEx, it would be great if the head is always the same - I & lt; Head & gt; From & lt; / Head & gt; Only inclusive and if possible delete the DOCTYPE from the text.

In addition to this it has to work in Silverlight and use the system. Text. Regular Expression or similar to work.

Regexes and HTML is a sin ...

< / Div>

Comments