I need help getting the firmware version from the output of the Cisco "show version" command
The following is the first line of the show version output (where "12.4(21a)JA1" is the firmware version):
Cisco IOS Software, C1240 Software (C1240-K9W7-M), Version 12.4(21a)JA1, RELEASE
SOFTWARE (fc1)
The below code gives me the error: couldn't compile regular expression pattern: quantifier operand invalid
expect "*#" {send "show version\n"}
expect -re "(?<=Version/s)(.*)(?=/sRELEASE)" {set var1 $expect_out(1,string)}
puts "Firmware Version: $var1"
Thanks for the help