日期:2014-05-16  浏览次数:21006 次

如何提取字段里的地址??
字段nr下有下面的字符:
<img alt="" src="/editor/attached/image/20130118/20130118180526942694.jpg" /><embed src="/editor/attached/flash/20130118/20130118180531003100.swf" type="application/x-shockwave-flash" width="550" height="400" quality="high" /><a href="/editor/attached/file/20130118/20130118180624112411.zip"  target="_blank">/editor/attached/file/20130118/20130118180624112411.zip</a>
怎么提取里面的所有地址,并循环显示:
/editor/attached/image/20130118/20130118180526942694.jpg
/editor/attached/flash/20130118/20130118180531003100.swf
/editor/attached/file/20130118/20130118180624112411.zip

------解决方案--------------------

str="<img alt="""" src=""/editor/attached/image/20130118/20130118180526942694.jpg"" /><embed src=""/editor/attached/flash/20130118/20130118180531003100.swf"" type=""application/x-shockwave-flash"" width=""550"" height=""400"" quality=""high"" /><a href=""/editor/attached/file/20130118/20130118180624112411.zip""  target=""_blank"">/editor/attached/file/20130118/20130118180624112411.zip</a>"
set reg=new RegExp
reg.Pattern = "\b(?:src
------解决方案--------------------
href)\s*=\s*("")([^""]+)\1"   
reg.IgnoreCase = True    
reg.Global = True   
Set Matches = reg.Execute(str)
For Each Match in Matches   
  response.write Match.SubMatches(1) 
Next