regex pattern:
objReg.Pattern = "((?:(\d{1,2}|[a-fA-F]{1,2}){2})(?::|-*)){6}"
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objRegExp = new RegExp
objRegExp.Pattern = "((?:(\d{1,2}|[a-fA-F]{1,2}){2})(?::|-*)){6}"
Set objFile = objFS.OpenTextFile("C:\logs\logfile.txt")
strFileContents = objFile.ReadAll
arrLines = Split(strFileContents,vbNewLine)
For Each strLine in arrLines
Set colMatches = objRegExp.Execute(strLine)
For Each strMatch in colMatches
WScript.Echo strMatch
Next
Next
No comments:
Post a Comment