Le sous-programme suivant peut essentiellement être considéré comme une correspondance générale relativement bonne. (PS: J'ai soudainement trouvé que Code_lite a échappé à mon UBB !!! J'étais tellement étourdi que je devais m'échapper ...)
Dimobjregexp, correspond, i, dc9_dot_cn_match
Dimarymatch ()
RedImpreservaryMatch (0)
SetObjregexp = newRegexp
objregexp.ignorecase = true
objregexp.global = true
objregexp.pattern = "(?: / [[^ /]] + /] ([^ / [] +) / [// [^ /]] + /]) | (? :( ?: href | src) = ([^ / s | ^>] +) [" "|> | / s / '])"
Setmatches = objregexp.execcute ("[img] 2312.jpg [/ img] [img] 2312.jpg [/ img] hh [img] http://www.dc9.cn/cm/upload/2ed312.jpg [/ img] <ahref =" "http://www.dc9 <href =" "http://www.dc9. 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/ss.J
Dimtmpmatch
Fori = 0Tomatches.Count-1
CalLinsertDatatoArray (Matches (I) .Submatches (0), arymatch)
CalLinsertDatatoArray (Matches (I) .Submatches (1), arymatch)
Suivant
Fori = 0Toubound (arymatch)
Ifnotisnull (arymatch (i)) andtrim (arymatch (i)) <> "" theresponse.writearymatch (i) & "<br>"
Suivant
FunctionInsertDatatoArray (données, byRefaryMatch)
Iftrim (data) <> "" puis
Data = remplacer (données, "'", "")
Data = remplacer (données, "" "", "")
Data = remplacer (données, "/", "/")
Data = split (data, "/") (ubound (Split (data, "/")))
RedImpreservarMatch (Ubound (arymatch) +1)
Dc9_dot_cn_match = false
Forj = 0Toubound (arymatch)
Ifarymatch (j) = datathendc9_dot_cn_match = true
Suivant
Ifnotdc9_dot_cn_matchthenarymatch (ubound (arymatch)) = données
Endire
Finition de fin
En fait, si Z-Blog est utilisé, il suffit de faire correspondre le téléchargement (mais pour enregistrer des problèmes et pour être plus précis, j'ajoute simplement le téléchargement à la correspondance ci-dessus, il semble donc que le suivant soit plus compliqué. En fait, théoriquement, celui suivant devrait être plus simple, après tout, il y a un téléchargement pour contrôler ...). Vous n'avez pas besoin de fendre /. Pour l'écrire comme ceci:
Dimobjregexp, correspond, i, zc_upload_match
Dimarymatch ()
RedImpreservaryMatch (0)
SetObjregexp = newRegexp
objregexp.ignorecase = true
objregexp.global = true
objregexp.pattern = "(?: / [[^ /]] + /] [^ / [] * upload // ([^ / [| ^ ^ // | ^ //] +) / [// [^ /] + /] ) | (? :( ?: href | src) = "" {0,1} [^ / s | ^ "" | ^> | ^ '] * upload // ([^ / s | ^>] +) ["" |> | / s /']) "
Setmatches = objregexp.execcute ("[img] 2312.jpg [/ img] [img] 2312.jpg [/ img] hh [img] http: // ww w.dc9.cn/cm/upload/2ed312.jpg@/IMG DMAL <AHREF= "" htt: //www.dc9.cn/ddd.jpg ""> </a> href = "" htt p: //www.dc9.cn/dccdd.jpg ""> [img_right = 400,300, titre] upload / 2assas.jpg [/ img_right] <S ceptsrc = "" 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)