The one area I am worst at is going to be the best solution for my need.
I am piping the output of an NSLOOKUP command to a variable and splitting that to create an array.
I want to filter out the lines that start with "Server:" as well as "Address:" and I also want to strip out the lines starting with:
"Microsoft (R)"
"Copyright (C)"
Here is what I have so far
What I would like to know is if there is a way to specify multiple strings to check against without nesting RegEx executions? Any help is greatly appreciated.
I am piping the output of an NSLOOKUP command to a variable and splitting that to create an array.
I want to filter out the lines that start with "Server:" as well as "Address:" and I also want to strip out the lines starting with:
"Microsoft (R)"
"Copyright (C)"
Here is what I have so far
Code:
nslookupinfo = Split(strNsLookupStdOut,vbCr)
'Declare our variable
Dim objRegExpr
'Create an instance of the regexp object
Set objRegExpr = New RegExp
objRegExpr.Pattern = "Address:"
objRegExpr.Global = True
objRegExpr.IgnoreCase = True
For Each line In nslookupinfo
Set colMatches = objRegExpr.Execute(line)
If colMatches.Count = 0 Then
If Len(line) > 1 Then
WScript.echo line
End If
End If
Next
What I would like to know is if there is a way to specify multiple strings to check against without nesting RegEx executions? Any help is greatly appreciated.