title: How do I parse HTML using regular expressions in C#?
body: <p>How do I parse HTML using regular expressions in C#?</p>
  
  <p>For example, given HTML code</p>
  
  <pre><code>&lt;s2&gt; t1 &lt;/s2&gt;  &lt;img src='1.gif' /&gt;  &lt;span&gt; span1 &lt;span/&gt;
  </code></pre>
  
  <p>I am trying to obtain</p>
  
  <pre><code>1.  &lt;s2&gt;
  2.  t1
  3. &lt;/s2&gt;
  4. &lt;img src='1.gif' /&gt;
  5. &lt;span&gt;
  6. span1
  7. &lt;span/&gt;
  </code></pre>
  
  <p>How do I do this using regular expressions in C#?</p>
  
  <p>In my case, the HTML input is not well-formed XML like XHTML. Therefore I can not use XML parsers to do this.</p>