日期:2014-05-18 浏览次数:21121 次
string source = "去除<a>......</a>字符串<a>......</a>中所有<a>......</a>超链接"; Regex reg = new Regex(@"<a>\w*\W*</a>"); source = reg.Replace(source, "");
------解决方案--------------------
string str = @"<span><a href=""http://www.baidu.com"">baidu</a><font>dfsafsa</font></span><a href=""http://www.baidu.com"">baidu</a>"; Regex reg = new Regex(@"<a\s*[^>]*>(.*?)</a>"); string res = reg.Replace(str, "");//res="<span><font>dfsafsa</font></span>"