[點(diǎn)晴永久免費(fèi)OA]asp中獲取內(nèi)容中所有圖片與獲取內(nèi)容中第一個(gè)圖片的代碼
代碼如下:
'===================================== '獲取內(nèi)容中所有圖片 '===================================== Function Get_ImgSrc(ByVal t0) Dim t1,Regs,Matches,Match t1="" IF Not(IsNull(t0) Or Len(t0)=0) Then Set Regs=New RegExp Regs.Pattern="<img[^>]+src=""([^"">]+)""[^>]*>" Regs.Ignorecase=True Regs.Global=True Set Matches=Regs.execute(t0) IF Matches.Count>0 Then For Each Match In Matches IF Left(Match.SubMatches(0),7)<>"http://" Then t1=t1&"<option value="""&Match.SubMatches(0)&""">"&Match.SubMatches(0)&"</option>" End IF Next End IF End IF Get_ImgSrc=t1 Set Matches=Nothing Set Regs=Nothing End Function '===================================== '獲取內(nèi)容中第一個(gè)圖片 '===================================== Function Frist_Pic(ByVal t0) Frist_Pic="" Dim Regs,Matches Set Regs=New RegExp Regs.Ignorecase=True Regs.Global=True Regs.Pattern="<img[^>]+src=""([^"">]+)""[^>]*>" Set Matches=Regs.execute(t0) IF Regs.test(t0) Then Frist_Pic=Matches(0).SubMatches(0) End IF Set Matches=Nothing Set Regs=Nothing End Function 該文章在 2022/6/21 17:50:39 編輯過(guò) |
關(guān)鍵字查詢(xún)
相關(guān)文章
正在查詢(xún)... |