发布:2023/12/7 16:00:33作者:管理员 来源:本站 浏览次数:472
String Content = "<div class=\"str_title\"><span><a href=\"/caifu\">更多>></a></span>财富故事</div><div class=\"str_title\"><span><a href=\"/aiqing\">更多>></a></span>爱情故事</div>";
Content = Regex.Replace(Content, "<a (.*?)>", "", RegexOptions.Compiled);//过滤a标签
Content = Regex.Replace(Content, "</a>", "");//替换a结束标签
Response.Write(Content);
String A_Content = Regex.Replace("<p style=\"text-align: center\"><img alt=\"百度\" src=\"http://www.baidu.com/img/baidu_sylogo1.gif\" /></p>", "alt=\"(.*?)\"", "alt=\"我是百度\"", RegexOptions.Compiled);//过滤alt属性
Response.Write(A_Content);
© Copyright 2014 - 2024 柏港建站平台 ejk5.com. 渝ICP备16000791号-4