The following subroutine can basically be considered a relatively good general match. (PS: I suddenly found that CODE_LITE escaped my UBB!!! I was so dizzy that I had to escape myself...)
DimobjRegExp,Matches,i,DC9_DOT_CN_MATCH
DimaryMatch()
RedimPreservearyMatch(0)
SetobjRegExp=NewRegExp
objRegExp.IgnoreCase=True
objRegExp.Global=True
objRegExp.Pattern="(?:/[[^/]]+/]([^/[]+)/[//[^/]]+/])|(?:(?:href|src)=([^/s|^>]+)[""|>|/s/'])"
SetMatches=objRegExp.Execute("[img]2312.jpg[/img][img]2312.jpg[/img]hh[img]http://www.dc9.cn/cm/upload/2ed312.jpg[/img]<ahref=""http://www.dc9.cn/ddd. jpg""></a>href=""http://www.dc9.cn/dccdd.jpg"">[IMG_RIGHT=400,300,title]upload/2assas.jpg[/IMG_RIGHT]<sceptsrc=""http://www.dc9.cn/upload/sss.jpg""")
DimTmpMatch
Fori=0toMatches.Count-1
CallInsertDataToArray(Matches(i).SubMatches(0),aryMatch)
CallInsertDataToArray(Matches(i).SubMatches(1),aryMatch)
Next
Fori=0toUbound(aryMatch)
IfNotIsNull(aryMatch(i))AndTrim(aryMatch(i))<>""ThenResponse.writearyMatch(i)&"<br>"
Next
FunctionInsertDataToArray(Data,ByRefaryMatch)
IfTrim(Data)<>""Then
Data=Replace(Data,"'","")
Data=Replace(Data,"""","")
Data=Replace(Data,"/","/")
Data=Split(Data,"/")(Ubound(Split(Data,"/")))
RedimPreservearyMatch(Ubound(aryMatch)+1)
DC9_DOT_CN_MATCH=False
Forj=0toUbound(aryMatch)
IfaryMatch(j)=DataThenDC9_DOT_CN_MATCH=True
Next
IfNotDC9_DOT_CN_MATCHThenaryMatch(Ubound(aryMatch))=Data
EndIf
EndFunction
In fact, if Z-Blog is used, it is enough to match Upload (but in order to save trouble and to be more precise, I simply add the upload to the above match, so it seems that the following one is more complicated. In fact, theoretically, the following one should be simpler, after all, there is an upload to control...). You don't need SPLit/. to write it like this:
DimobjRegExp,Matches,i,ZC_UPLOAD_MATCH
DimaryMatch()
RedimPreservearyMatch(0)
SetobjRegExp=NewRegExp
objRegExp.IgnoreCase=True
objRegExp.Global=True
objRegExp.Pattern="(?:/[[^/]]+/][^/[]*upload//([^/[|^//|^//]+)/[//[^/]+/])|(?:(?:href|src)=""{0,1}[^/s|^""|^>|^']*upload//([^/s|^>]+)[""|>|/s/'])"
SetMatches=objRegExp.Execute("[img]2312.jpg[/img][img]2312.jpg[/img]hh[img]http://www.dc9.cn/cm/upload/2ed312.jpg[/img]<ahref=""htt://www.dc9.cn/ddd.jpg""></a>href=""htt p://www.dc9.cn/dccdd.jpg"">[IMG_RIGHT=400,300,title]upload/2assas.jpg[/IMG_RIGHT]<sceptsrc=""http://www.dc9.cn/upload/sss.jpg""src=http://www.dc9.cn/upload/sss.jpg'>")
DimTmpMatch
Fori=0toMatches.Count-1
CallInsertDataToArray(Matches(i).SubMatches(0),aryMatch)