网络编程教程
ASP如何正确匹配img标签技巧
asp/Visual Basic代码:
程序代码
<%
'***************************************************
'*函数名 : GetImgFromContent
'*参数说明 : html 被提取的html 代码
'*功能简介 : 提取这部分html代码中的图片
'*程序作者 : evio http://www.backci.cn/code
'*http://www.knowsky.com/
'***************************************************
function GetImgFromContent(html)
Dim Re, match, matchs, htm, t
htm = ""
set Re = new RegExp
re.IgnoreCase =True
re.Global = True
re.Pattern = "<img [^<]*src=""(.*)""[^>]*>" '--<img [^<]*src=""(.*)""[^>]*>
Set matchs = re.Execute(html)
for each match in matchs
htm = htm + (match.SubMatches(0)) & "|$|"
next
set matchs = nothing
t = split(htm, "|$|")(0)
if len(t) = 0 or t = "" then
t = "_template_Images/PRive.jpg"
end if
ze = "<img src='" & t & "' width='191' height='119' />"
end function
%>
本文关键词:ASP匹配img标签技巧,img标签
本文《ASP如何正确匹配img标签技巧》是由合肥德曼电脑培训中心原创或来源网络信息整理!
本文网页路径:http://www.dmseo.com/asp/314.html