国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

ASP如何獲得代碼中第一張圖片地址

2019-11-18 16:27:27
字體:
來源:轉載
供稿:網友

'把pattern 又修改了下
'code要檢測的代碼
'http://m.survivalescaperooms.com/asp.asp
'leixing html 或者ubb
'nopic 代碼沒有圖片時默認值
function toppic(code,leixing,nopic)
        set regex = new regexp
        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


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 广昌县| 稻城县| 隆尧县| 吉首市| 福建省| 德兴市| 临清市| 深州市| 建德市| 米林县| 陆丰市| 常州市| 甘洛县| 达孜县| 建宁县| 盈江县| 和田市| 克什克腾旗| 博乐市| 突泉县| 资溪县| 南城县| 晋城| 辽宁省| 称多县| 安国市| 上林县| 怀远县| 罗甸县| 兴安县| 宝应县| 宜川县| 临高县| 嘉祥县| 磴口县| 临邑县| 繁峙县| 绥中县| 那曲县| 东明县| 裕民县|