码迷,mamicode.com
首页 > 其他好文 > 详细

过滤资源地址

时间:2014-05-16 20:00:47      阅读:266      评论:0      收藏:0      [点我收藏+]

标签:style   blog   class   code   c   java   

bubuko.com,布布扣
 string strPatten = "(src|href)=(.*?)[>| ]"; 
        string strContent = "<img src=\"http://su.bdimg.com/static/superplus/img/loading_deadaef0.gif\" ><script src=‘http://s1.bdstatic.com/r/www/cache/static/global/js/all_async_d47e7b7d.js‘></script>  <link href=\"/assets/sh-2bfcf65754f6d04d58df6ed87a3b6faf.css\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />";
        Regex reg = new Regex(strPatten);
        foreach (Match match in reg.Matches(strContent))
        {
            for (int i = 0; i < match.Groups.Count; i++)
            {
                Response.Write(i + ":" + match.Groups[i].Value + "<br>");
            }
        }
        Response.Write("成功!<br>");
        Response.End();
bubuko.com,布布扣

 

过滤资源地址,布布扣,bubuko.com

过滤资源地址

标签:style   blog   class   code   c   java   

原文地址:http://www.cnblogs.com/xyzhuzhou/p/3725325.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!