28,391
社区成员
发帖
与我相关
我的任务
分享
function GetImgSrc(str) '取得img 标签内容
dim tmp
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True '忽略大小写
objRegExp.Global = True '全文搜索 !关键!
objRegExp.Pattern = "<img[\s\S]+?src=[""']?([^""']{4,}?)[""'][\S\s]*?[/]?>"
Set Matches =objRegExp.Execute(str)
If Matches.Count> 0 Then
tmp=objRegExp.rePlace(Matches(0), "$1")
End If
GetImgSrc="<img src="""&tmp&""">"
end function
response.write GetImgSrc("dsfsdfsdf <IMG src=""/view/edit/UploadFile/2.jpg"" border=0>sdfsdfsd <IMG src=""/view/edit/UploadFile/1.jpg"" border=0>")&"<br>"