正则表达式只返回一次结果
xlcc 2009-04-05 01:10:09 Function getImages(Str)
Set re = New RegExp
re.Pattern = "<img(.+?)src=""*([^\s]+?)""*(\s|>)"
re.Global = True
re.IgnoreCase = True
Set Contents = re.Execute(Str)
For Each Match in Contents ' 遍历匹配集合。
Images = Images + Match.SubMatches(1) + "|"
Next
getImages = Mid(Images, 1, Len(Images) -1)
End Function
文章中有多个JPG,如果只选择第一个JPG?