+ and % as regular expression in IOS question
szmarcek
Member Posts: 33 ■■□□□□□□□□
so I wonder about the following .+ -- would be any standard dtmf character and then repeated one or more time so .+ could be 00000 or 11111 or 111however, could .+ be 012323 or 32342 etc? or if the dot is 1 then it has to be one or more of instances of 1, if the dot is 2 then it has to be one or more instances of 2 etc .% - could it be 01 or 02 or 012 or 123 etc. So do the digits represented by % have to be the same as the digit matched by . sign? #Thanks
Comments
-
PCHoldmann Member Posts: 450It would match any string, not just repeats of a single digit.
Cisco IOS Voice, Video, and Fax Configuration?Guide, Release?12.2 - Configuring Dial Plans, Dial Peers, and Digit Manipulation [Cisco IOS Software Releases 12.2 Mainline] - Cisco
Normally I prefer a more exact match, it lessens the likelihood of mistakes. If you need to match any terminating string, like a single dial peer for anything starting in 9, Cisco provides "T" so your dial peer would match "9T".There's no place like ^$
Visit me at Route, Switch, Blog -
szmarcek Member Posts: 33 ■■□□□□□□□□thanks for replying. So can you confirm that if you do under dial-peer destination pattern .+ordestination pattern .Tboth would match any string that you will dial (well almost any as .+ would need at least two digits whereas .T would match 1 digit too)?Thanks
-
PCHoldmann Member Posts: 450Either one (.+ or .T)will match anything over a single digit. .T seems to be the more "standard" way to do it, and the way I would stick with.There's no place like ^$
Visit me at Route, Switch, Blog