This is one of the simplest regex to remove html tags from some html text. I know its not the best but i’d argue that it’s one of the simplest. ;)
public static string RemoveHtml(string txt)
{
return Regex.Replace(txt, @"<[^>]*>", "");
}
Filed under: Technical | Tagged: .net, html, regex, tags, xml | 2 Comments »