asp.net 正则表达式过滤所有html标签

     String CleanInput(string strIn)
{
// Replace invalid characters with empty strings.
// Replace all html tags
return Regex.Replace(strIn, @"</?[^>]*>", "");
// Replace html tags div or span
//return Regex.Replace(strIn, @"</?(div|span)[^>]*>", "");
}



原文地址:https://www.cnblogs.com/lear/p/2391296.html