'====================================================================
'Function name: ReplaceSaveRemoteFile
'Function: replace and save remote pictures
'Arguments: ConStr----------------------------------------------------------------------------------------------------------------------
'Parameters: SaveTf------ Whether to save the file, False does not save, True save
'Parameters: TistUrl--------Current web address
'====================================================================
FunctionReplaceSaveRemoteFile(ConStr,strInstallDir,strChannelDir,SaveTf,TistUrl)
IfConStr="$False$"orConStr=""orstrChannelDir=""Then
ReplaceSaveRemoteFile=ConStr
ExitFunction
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<>""then
TempStr=TempStr&"$Array$"&Match.Value
Else
TempStr=Match.Value
Endif
Next
IfTempStr<>""Then
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<>""then
TempStr=TempStr&"$Array$"&Match.Value
Else
TempStr=Match.Value
Endif
Next
Next
Endif
IfTempStr<>""Then