Question: I am using the following Regular Expresion to remove html tags from a string. It works except I leave the closing tag. If I attempt to remove: `<a href="blah">blah</a>` it leaves the `<a/>`.

I do not know Regular Expression syntax at all and fumbled through this. Can someone with RegEx knowledge please provide me with a pattern that will work.

Here is my code:

```
  string sPattern = @"<\/?!?(img|a)[^>]*>";
  Regex rgx = new Regex(sPattern);
  Match m = rgx.Match(sSummary);
  string sResult = "";
  if (m.Success)
   sResult = rgx.Replace(sSummary, "", 1);

```

I am looking to remove the first occurence of the `<a>` and `<img>` tags.

Answer: 
So the HTML parser everyone's talking about is [Html Agility Pack](http://htmlagilitypack.codeplex.com/).

If it is clean XHTML, you can also use `System.Xml.Linq.XDocument` or `System.Xml.XmlDocument`.
Why not trying reluctant quantifier?
 `htmlString.replaceAll("<\\S*?>", "")`

*(It's Java but the main thing is to show the idea)*