<%
str="<img src=images/200610261533.jpg?http://www.xvna.com><img src=""images/200609151656.jpg?http://www.xvna.com""><img src=images/200609051735.JPG>"
response.write(GetImgSrc(str))
function GetImgSrc(str) '取得img 标签内容
dim tmp
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True '忽略大小写
objRegExp.Global = false '全文搜索 !关键!
objRegExp.Pattern = "<img (.*?)src=(.[^\[^>]*)(.*?)>"
Set Matches =objRegExp.Execute(str)
For Each Match in Matches
tmp=tmp & Match.Value
Next
GetImgSrc=getimgs(tmp)
end function
function getimgs(str)'取得
Set objRegExp1 = New Regexp
objRegExp1.IgnoreCase = True '忽略大小写
objRegExp1.Global = True '全文搜索
objRegExp1.Pattern = "src\=.+?\.(gif|jpg|png|bmp)"
set mm=objRegExp1.Execute(str)
For Each Match1 in mm
imgsrc=Match1.Value
'也许存在不能过滤的字符,确保万一
imgsrc=replace(imgsrc,"""","")
imgsrc=replace(imgsrc,"src=","")
imgsrc=replace(imgsrc,"<","")
imgsrc=replace(imgsrc,">","")
imgsrc=replace(imgsrc,"img","")
imgsrc=replace(imgsrc," ","")
getimgs=getimgs&imgsrc'把里面的地址串起来备用
next
end function
%>