title: Removing incomplete P Tags (using REGEX or any other method)
body: <p>my problems is a bit case specific ,</p>
  
  <p>first of all,</p>
  
  <p>Its only for <code>&lt;p&gt;</code>tags not for any other tag.So you need not worry about any other tag.</p>
  
  <p>I am having html document which is a output of one software  ,but it has some errors like unclosed <code>&lt;p&gt;</code> tags.</p>
  
  <p>eg.
  I have taken all document in a string</p>
  
  <p>my document is like ..</p>
  
  <pre><code>    &lt;html&gt;
      ....
      ....
        &lt;head&gt;
        &lt;/head&gt;
      ....
      ....
         &lt;body&gt;
  
      ...
      ...
      &lt;p&gt;                 // tag is to be removed as no closing tag
  
  &lt;p align="left"&gt;   AAA   &lt;/p&gt;
  &lt;p class="style6"&gt;   BBB    &lt;/P&gt;
  &lt;p class="style1" align="center"&gt;    CCC    &lt;/P&gt;
  
  &lt;p align="left"&gt;  DDD               // tag is to be removed as no closing tag
  &lt;p class="style6"&gt;   EEE              // tag is to be removed as no closing tag
  &lt;p class="style1" align="center"&gt;    FFF             // tag is to be removed as no closing tag
  
  &lt;p class="style15"&gt;&lt;strong&gt;xxyyzz&lt;/strong&gt;&lt;br/&gt;&lt;/p&gt;
  
  &lt;p&gt;                // tag is to be removed as no closing tag
  
  
  
  &lt;p&gt; stack Overflow &lt;/P&gt;
  
  
         &lt;body&gt;
        &lt;/html&gt;
  </code></pre>
  
  <p>tags with DDD,EEE,FFF and unclosed <code>&lt;p&gt;</code> tag are to be removed 
  As you can see it should work for every unclosed <code>&lt;P&gt;</code> tag whether it is having attributes like class or align.</p>
  
  <p>I also want to mention that, there is no <code>&lt;p&gt;</code> tag inside another <code>&lt;p&gt;</code> tag ,i mean</p>
  
  <pre><code>&lt;p&gt;
      &lt;p&gt;
      &lt;/p&gt;
  
       &lt;p&gt;
       &lt;/p&gt;
  
  &lt;/p&gt;
  </code></pre>
  
  <p>Such condition will never occur .</p>
  
  <p>I tried using REGEX and StringBuilder but could not get perfect answer.</p>
  
  <p>Thanx a lot in advance for those who will help.</p>
  
  <p>Regards</p>