Regular Expression Help
Could i get help with a regular expression?
I want to differentiate between 2 devices, an ex4200-24f and an ex4550-32f.
In the CLI the lines that i need to match on look like:
I want to pull the 4200 or the 4550 from the CLI, and match on the number
The 4200 will have a different set of snaps and the 4550 will have a different set of snaps.
This is what i got so far setup.
crt.Screen.Synchronous = True
crt.Screen.IgnoreEscape = True
crt.Screen.Send "show version" & vbcr
strOutput = crt.Screen.ReadString(">")
Set re = New RegExp
re.MultiLine = True
re.Global = True
re.IgnoreCase = True
re.Pattern = "\s(:\s)ex\d+\s" 'Trying to pull the ex4**0- out. looking at the whitespace after the :
'wanting to debug the regex, and see what i found
If re.Test(strOutput) Then
crt.Dialog.MessageBox re.Test(strOutput) ' pulling what the regex found and display it
crt.Dialog.MessageBox "nothing was found"
|regular expression , scripting|
|Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)|
|Display Modes||Rate This Thread|