/ (?m: # not capture, multiline .* # skip anything [\w\.-]+ # the 'device' name part \s? (?:\(config[^\)]*\))? # random '(config...)' part \s? [\$#?>] # real prompt end part \s? (?:\(enable\))? \s* # random '(enable)' part $) /x
You're missing the '\' escape of the '.' in the device part. It's supposed to be a hostname like thing: foo-bar.baz10.com and needs to match a literal period '\.'.
You also may need to set the timeout a bit longer depending on how long it takes to download.
What you really want to do is know the device name in advance, or get it from the last-prompt after you login. Then replace the [\w\.-]+ part of the regex with the actual name of the device.
In reply to Re^2: Net::Telnet::Cisco and prompt regex issue
by Anonymous Monk
in thread Net::Telnet::Cisco and prompt regex issue
by josh803316
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |