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

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

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

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

'把pattern 又修改了下
'code要檢測的代碼
'http://www.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


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 高清| 哈巴河县| 黄石市| 平安县| 太仆寺旗| 锡林浩特市| 莎车县| 抚松县| 叙永县| 莒南县| 固镇县| 巴青县| 甘孜| 郴州市| 台南市| 五大连池市| 宁陕县| 页游| 黑水县| 惠水县| 田东县| 平塘县| 扎鲁特旗| 新营市| 长沙市| 临夏市| 习水县| 临武县| 监利县| 武强县| 融水| 三明市| 大渡口区| 孝感市| 上栗县| 涟水县| 松桃| 南宫市| 万源市| 富裕县| 盐津县|