加入收藏 | 会员中心 | 繁體中文 | 留言信息 | |
推 荐 阅 读

广 告 发 布 商

阅 读 排 行
 您现在的位置: 中国无边在线 >> 文章频道 >> 网页作坊 >> 特效代码 >> 文章正文
如何用ASP获得代码中第一张图片地址? 【字体:

如何用ASP获得代码中第一张图片地址?

     作者:佚名   文章来源:本站原创  点击:     


'把pattern 又修改了下
'code要检测的代码
'http://www.knowsky.com/asp.asp
'leixing html 或者ubb
'nopic 代码没有图片时默认值
function toppic(code,leixing,nopic)
        set regex = new rege
xp
        regex.ignorecase = true
        regex.global = true
        if leixing = "html" then
                regex.pattern = "<img(.*?)src/s?/=/s?(/u0022?)([^/u0022//>]+)"
        else
                regex.pattern = "/[img/]([^/u005B]+)“
        end if
        set matches = regex.execute(code)
        if regex.test(code) then
                                  if leixing = "html" then
                           toppic = matches(0).submatches(3)
                                  else
                                           toppic = matches(0).submatches(0)
                                  end if
        else
                toppic = nopic
        end if
end function
code1 = "<img src=""1.gif"">"
pic = toppic(code1,"html","nopic.gif")
response.Write pic

文章录入:烧饼    责任编辑:烧饼 
 
  • 上一篇文章:
  •                 
  • 下一篇文章:
  •  

      08年最新韩版款式
    个人之见之如何解封百度封站
    在DOS下如何才能找到U盘
    如何解决企业网络IP地址盗用
    欧洲色情垃圾邮件大王低头 微
    发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口



    中国无边在线
    www.wb889.com
    我的网络生活从这里开始……

      设为首页 / 加入收藏 / 友情链接 / 购买广告位 / 广告合作 / 用户留言 / 版权申明

    · 中国无边在线www.wb889.com 前身:烧饼工作室 请勿盗链
    · 业务QQ:94125148 | 78533587 E-mail:wb889#126.com TEL:020-3157797*
    · ICP备案号:粤ICP备05123509号 我的网络生活从这里开始了……