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)[^>]*>", "");
}



posted @ 2012-03-12 09:28  lear  阅读(238)  评论(0编辑  收藏  举报