日期:2014-05-17  浏览次数:20894 次

如何用asp取出一段html代码中所有的图片地址?
比如有这么一段代码:()
aaa= " <img   src=http://www.163.com/aaa.gif> <img   src=http://www.163.com/123.gif> <img   src=http://www.163.com/dsa.gif> "

(上面以三个举例,可能会有多个)

如何用asp(vb)分析aaa,取出所有的图片地址并用“|”分开

取出结果如下:
http://www.163.com/aaa.gif|http://www.163.com/123.gif|http://www.163.com/dsa.gif

请高手帮忙

------解决方案--------------------
aaa= " <img src=http://www.163.com/aaa.gif> <img src=http://www.163.com/123.gif> <img src=http://www.163.com/dsa.gif> "
s = " "
Set regEx = New RegExp
regEx.Pattern = " <img src=(.+?)> "
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(aaa)
For Each Match in Matches
s = s & Match.SubMatches(0) & "| "
Next

response.write s