复制代码 代码如下:
=====================================
获取内容中所有图片
=====================================
Function Get_ImgSrc(ByVal t)
Dim tRegsMatchesMatch
t=
IF Not(IsNull(t) Or Len(t)=) Then
Set Regs=New RegExp
RegsPattern=<img[^>]+src=([^>]+)[^>]*>
RegsIgnorecase=True
RegsGlobal=True
Set Matches=RegsExecute(t)
IF MatchesCount> Then
For Each Match In Matches
IF Left(MatchSubMatches())<>// Then
t=t&<option value=&MatchSubMatches()&>&MatchSubMatches()&</option>
End IF
Next
End IF
End IF
Get_ImgSrc=t
Set Matches=Nothing
Set Regs=Nothing
End Function
=====================================
获取内容中第一个图片
=====================================
Function Frist_Pic(ByVal t)
Frist_Pic=
Dim RegsMatches
Set Regs=New RegExp
RegsIgnorecase=True
RegsGlobal=True
RegsPattern=<img[^>]+src=([^>]+)[^>]*>
Set Matches=RegsExecute(t)
IF Regstest(t) Then
Frist_Pic=Matches()SubMatches()
End IF
Set Matches=Nothing
Set Regs=Nothing
End Function