$file = FileOpen("1.txt", 0)
$chars = FileRead($file)
FileClose($file)
$nOffset = 1
While 1
$ip = StringRegExp($chars,'((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)', 2,$nOffset)
If @error = 0 Then
$nOffset = @extended
Else
ExitLoop
EndIf
$port = StringMid($chars,$nOffset+1,4)
If $ip[0] <> '127.0.0.1' And $port = '8563' Then
;~ MsgBox(0, $port , $ip[0])
$chars = StringReplace($chars, $ip[0] , "97.121.124.125")
$file = FileOpen("1.txt", 2)
FileWrite($file,$chars)
FileClose($file)
EndIf
WEnd
使用正则查找 |