09-08-2022 08:55 PM
I am trying to use different types of network devices, but I cannot use more complex regular expressions.
For Cisco equipment, I have:
expect {"*>"}
* Functioning normally
But for Fortinet devices, I want to do this
expect {"^[a-zA-Z0-9_.-\s]+[#]"}
But it didn't work. I checked a REGEX "checker" to make sure the expression was correct and that it seemed to work. So basically, I want to filter out the line that starts with "NAME_OF_DEVICE #," because that's what happens when you first connect to Fortinet shell
Do you know why it can't work?
09-09-2022 12:06 AM
If the TCL script not working on fortinet, you need to post this in Fortinet forum for better addressing your issue, how Cisco community can address the issue here ?
look at Fortinet TCL usage :
09-09-2022 12:13 AM
Nǐ hǎo,
which Regex checker are you using ? Mine is complaining about the '-' character:
expect {"^[a-zA-Z0-9_.-\s]+[#]"}
Can you try the regexp without the hyphen ?
expect {"^[a-zA-Z0-9_.\s]+[#]"}
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide