日期:2014-05-18 浏览次数:20858 次
string result = Regex.Replace(str, @"<td.*?id=""td2""[^>]*>[\s\S]*?</td>", "", RegexOptions.IgnoreCase);
------解决方案--------------------
string str = "比如 <table> <tr> <td id=\"td1\"> </td> <td id=\"td2\"> </td> </tr> </table>"; string result = Regex.Replace(str, "<td\\s*id=\"td2\"[^>]*>[\\s\\S]*?</td>", "", RegexOptions.IgnoreCase);