比如像这种文章
 
<a href="#">测试链接</a>我要写个正则过滤掉超链接,只剩下链接中的文字,但图片的超链接不用过滤,麻烦各位帮我解决,非常感谢!

解决方案 »

  1.   

    Regex re = new Regex("(?is)(?<=>)[^<>]+(?=<)", RegexOptions.None);
            MatchCollection mc = re.Matches("<a href=\"#\">测试链接</a>");
            foreach (Match ma in mc)
            {
                Response.Write(ma.Value);
            }
      

  2.   

    <a href=""#"">测试链接></a><a href=""#""><img src="""" />adf</a>
    这咋搞!~。。
      

  3.   

    string str=@"<a href=""#"">测试链接></a><a href=""#""><img src="""" />adf</a>";
      

  4.   

    好吧!~既然1楼能满足。你用替换吧。
    Regex re = new Regex("(?is)(?<=>)[^<>]+(?=<)", RegexOptions.None);
    re.Replace(str,"$1");