vbs试试?- Set FSO = CreateObject("Scripting.FileSystemObject")
- Text = FSO.OpenTextFile("WindowsUpdate.log",1).ReadAll
- CreateMyFile "kb[0-9]{6,7}","a.txt"
- CreateMyFile "http://.*?\.exe","b.txt"
- MsgBox "OK"
-
- Sub CreateMyFile(Pattern,File)
- Set Re = New RegExp
- Re.Pattern = Pattern
- Re.Global = True
- Re.IgnoreCase = True
- For Each Match in Re.Execute(Text)
- If InStr(LCase(Str), LCase(Match)) = 0 Then
- Str = Str & Match & vbCrLf
- End If
- Next
- FSO.CreateTextFile(File,True).Write Str
- Str = ""
- End Sub
复制代码
|