//过滤
转换成空
String withoutNString=message.Replace("
", "");
//过滤
转换成空
String withoutRString = withoutNString.Replace("
", "");
//过滤 转换成空
String withoutTString = withoutRString.Replace(" ", "");
//过滤 转换成空
String newString = withoutTString.Replace("\", "");
//获取html中的body标签
String result = Regex.Match(newString, @"<body.*>.*</body>").ToString();
//过滤注释
String result2 = Regex.Replace(result, @"<!--(?s).*?-->", "", RegexOptions.IgnoreCase);
//过滤nbsp标签
String result3 = Regex.Replace(result2, @" ", "", RegexOptions.IgnoreCase);
//获取body中的所有table
Regex regex = new Regex(@"<table.*?>[sS]*?</table>");
MatchCollection mc = regex.Matches(result3);
//获取集合类中自己需要的某个table
String newHtmlStr = mc[3].ToString();