'=======================================================================
'Nome da função: substituaveroterofile
'Função: Substitua e salve fotos remotas
'Argumentos: Constr --------------------------------------------------------------------------------------------------------------------------------------------
'Parâmetros: Savetf ------ se deve salvar o arquivo, false não salva, verdadeiro salvar
Parâmetros: Tisturl -------- Endereço da Web atual
'=======================================================================
FunctionReplacesveroteroteFile (Constr, Strinstalldir, Strchanneldir, Savetf, Tisturl)
Ifconstr = "$ false $" orconstr = "" Orstrchanneldir = "" então
SubstituaveroteroteFile = Constr
Saída de saída
Endif
Dimtempstr, Tempstr2, Tempstr3, Re, Matches, Match, Temppi, Temparray, Temparray2
Setre = newRegexp
Re.IGNORECASE = true
Re.global = true
Re.pattern = "<img.+? [^/>]>"
SetMatches = re.execute (constr)
ForeachMatchinMatches
Iftempstr <> "" então
Tempstr = tempstr & "$ array $" & match.value
Outro
Tempstr = match.value
Endif
Próximo
Iftempstr <> "" então
Temparray = split (tempstr, "$ array $")
Tempstr = ""
Fortempi = 0Toubound (Temparray)
Re.pattern = "src/s*=/s*.+?/. (Gif | jpg | bmp | jpeg | psd | png | svg | dxf | wmf | tiff)"
SetMatches = re.execute (Temparray (tempi))
ForeachMatchinMatches
Iftempstr <> "" então
Tempstr = tempstr & "$ array $" & match.value
Outro
Tempstr = match.value
Endif
Próximo
Próximo
Endif
Iftempstr <> "" então