title: VB.Net or C# to strip html but leave less than or greater than
body: <p>I have a string variable that contains the following html data:</p>
  
  <p><code>&lt;p&gt;
      &lt;em&gt;&lt;strong&gt;This is some &lt;span style="background-color: rgb(255, 255, 0);"&gt;rich &lt;/span&gt;text. 3 &lt; 5 is a valid statement. &lt;br /&gt;
      &lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;</code></p>
  
  <p>I need to be able to strip out the html, but leave any less than or greater than signs in case the data contains mathematical equations (like the "3 &lt; 5" portion of the string). I am not able to use 3rd party applications/tools due to some restrictions of our site, and would prefer to use anything that is in the .net framework version 3.5. I have tried the regular expressions that follow, but they do not handle the less than/ greater than symbols. </p>
  
  <p><code>&lt;[^&gt;]*&gt;</code><br>
  <code>&lt;[^&gt;]+&gt;</code><br>
  <code>&lt;(.|\n)*?&gt;</code> <br>
  <code>\&lt;[^\&gt;]*\&gt;</code> <br></p>
  
  <p>I have also tried the code on <a href="https://web.archive.org/web/20210619174622/https://www.4guysfromrolla.com/webtech/042501-1.shtml" rel="nofollow">this link</a>, but it also does not handle the less than / greater than symbols either.</p>
  
  <p>Any suggestions are greatly appreciated.</p>