There are still bugs at present, and the latest test page is: http://www.reallydo.com/getimg.asp
The regular analysis page is at: http://jorkin.reallydo.com/article.asp?id=380
If you find a bug, please leave a message later, thank you.
1.31 Correction
src=The spaces after it cannot match correctly. Fixed.
An error occurred when src='' is empty. Fixed.
BUG was found: Only one can be retained when the image path has multiple spaces. Uncorrected.
2.18 Correction
When the image path has multiple spaces, only one bug can be retained. Fixed.
The code copy is as follows:
<%
'Function: Get all image addresses and save them to an array.
'Source: http://jorkin.reallydo.com/article.asp?id=448
'ReplaceAll function is required: http://jorkin.reallydo.com/article.asp?id=406
FunctiongetIMG(sString)
DimsReallyDo,regEx,iReallyDo
DimoMatches,cMatch
'//Define an empty array
iReallyDo=-1
ReDimaReallyDo(iReallyDo)
IfIsNull(sString)Then
getIMG=""
ExitFunction
EndIf
'//Format HTML code
'//Bring each <img line break to facilitate regular replacement
sReallyDo=sString
OnErrorResumeNext
sReallyDo=Replace(sReallyDo,vbCr,"")
sReallyDo=Replace(sReallyDo,vbLf,"")
sReallyDo=Replace(sReallyDo,vbTab,"")
sReallyDo=Replace(sReallyDo,"<img",vbCrLf&"<img",1,-1,1)
sReallyDo=Replace(sReallyDo,"/>","/>",1,-1,1)
sReallyDo=ReplaceAll(sReallyDo,"=","=",True)
sReallyDo=ReplaceAll(sReallyDo,">",">",True)
sReallyDo=Replace(sReallyDo,"><",">"&vbCrLf&"<")
sReallyDo=Trim(sReallyDo)
OnErrorGoTo0
SetregEx=NewRegExp
regEx.IgnoreCase=True
regEx.Global=True
'//Remove onclick, onload and other scripts
regEx.Pattern="/s[on].+?=([/""|/'])(.*?)/1"