'============================================================.
'Nom de la fonction: ReplateleMotefile
«Fonction: remplacer et enregistrer des images distantes
'Arguments: CONSTR ----------------------------------------------------------------------------------------------------------------------
'Paramètres: SAVETF ------ Si vous devez enregistrer le fichier, FALSE n'enregistre pas, vrai sauvegarder
'Paramètres: Tisturl -------- Adresse Web actuelle
'============================================================.
FunctionReplaceSavelemotefile (CONSTR, strinstalldir, strChanneldir, Savetf, Tisturl)
IfConstr = "$ false $" orconstr = "" orstrChanneldir = "" puis
ReplaceSeemotefile = CONSTRAL
Sortie
Endire
Dimtemptr, Temptr2, Temptr3, Re, Matches, Match, Temppi, Temparray, Temparray2
SetRe = newRegexp
Re.ignorecase = true
Re.global = true
Re.Pattern = "<img. +? [^ />]>"
Setmatches = re.execute (hent)
Foreachmatchinmatches
IfTemptr <> "" alors
TEMPSTR = TEMPSTR & "$ Array $" & Match.Value
Autre
Temptr = Match.Value
Endire
Suivant
IfTemptr <> "" alors
Temparray = Split (Temptr, "$ array $")
Temptr = ""
Fortempi = 0Toubound (temparray)
Re.Pattern = "src / s * = / s *. +? /. (Gif | jpg | bmp | jpeg | psd | png | svg | dxf | wmf | tiff)"
Setmatches = re.execute (temparray (tempi))
Foreachmatchinmatches
IfTemptr <> "" alors
TEMPSTR = TEMPSTR & "$ Array $" & Match.Value
Autre
Temptr = Match.Value
Endire
Suivant
Suivant
Endire
IfTemptr <> "" alors