'=====================================================================
'Nome da função: reasaveremotefile
'Função: encontre o arquivo salvar e substituir
'Argumentos: str ---- String original
'Parâmetros: URL --- é claro que o URL do site
Parâmetros: dir ---- SALVAR DIRETORY
Parâmetros: insave --------- Salvar, verdadeiro, falso
'Valor de retorno: string formatada
'=====================================================================
PublicFunctionResaveroteFile (Byvaltr, Byvalurl, Byvaldir, Instave)
Dims_content
Dimre
DimContentFile, ContentFileurl
Dimstrtempurl, Strfileurl, Dirtemp, PathTemp, FileTemp, Temp, TempurLarray, ARR_PATH
DimsallowExtName
sallowextname = "rm | swf"
s_content = str
OnErrorReSumenext
Setre = newRegexp
re.IGNORECASE = true
re.global = true
re.pattern = "((src = | href =) ((/s)+[.] {1} (" & sallowextName & "))"
SetContentFile = re.execute (s_content)
Dimscontenturl (), n, i, brepeat
n = 0
ForeachContentFileUrlincontentFile
strfileurl = substituir (substituir (substituir (substituir (substituir (contentfileurl.value, "src =", "", 1, -1,1), "href =", "", 1, -1,1), "" "" ""), chr (34), "")
Ifn = 0then
n = n+1
RedimScontenturl (n)
scontenturl (n) = strfileurl