我有一些代码可以删除所有HTML标签,但我想要删除除
</td>
和</tr>
标签之外的所有HTML标签。如何做到这一点?public string HtmlStrip( string input)
{
input = Regex.Replace(input, "<input>(.|\n)*?</input>", "*");
input = Regex.Replace(input, @"<xml>(.|\n)*?</xml>", "*"); // remove all <xml></xml> tags and anything inbetween.
return Regex.Replace(input, @"<(.|\n)*?>", "*"); // remove any tags but not there content "<p>bob<span> johnson</span></p>" becomes "bob johnson"
}
<td>
和<tr>
)呢? - Kenneth K.