Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Community Member

Interesting destination-pattern regex puzzle

Hi Experts,

I am trying to write a single regular expression for the destination-pattern command to match all 4 digit numbers except 41XX and 42XX ?

Can you pelase help me?

Thanks,

Bala.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Interesting destination-pattern regex puzzle

Funny.  Sorry, I just assumed you were concerned with the 4xxx range.  Anyway, for this you will need two dial-peers.

To match: 1000-4099 and 4300-9999

One dial-peer destination pattern: 4[0,3-9]..

The other dial-peer destination pattern: ^0^4...  (which means that the first digit can't be a 0 or a 4)

HTH.

Regards,

Bill

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

5 REPLIES

Re: Interesting destination-pattern regex puzzle

You could use:

destination-pattern 4[0,3-9]..

See this link for more information and ideas on how you can use wildcards with destination patterns:

http://www.cisco.com/en/US/docs/ios/voice/dialpeer/configuration/guide/vd_dp_feat_cfg_ps6441_TSD_Products_Configuration_Guide_Chapter.html#wp1067070

HTH.

Regards,

Bill

Please remember to rate helpful posts.

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

Community Member

Re: Interesting destination-pattern regex puzzle

Hi Bill,

Thanks a lot for your reply and the link.

destination-pattern 4[0,3-9] will match only numbers in the raneg 40XX and 43XX-49XXX.

I ws looking for a single destination pattern that will match all 4 digit extensions except 41xx and 42xx (all numbers in the range 1000-4099 and 4300-9999).

Any ideas on constructing the desired range using a single reg-ex?

Thanks,

Bala.

Re: Interesting destination-pattern regex puzzle

Funny.  Sorry, I just assumed you were concerned with the 4xxx range.  Anyway, for this you will need two dial-peers.

To match: 1000-4099 and 4300-9999

One dial-peer destination pattern: 4[0,3-9]..

The other dial-peer destination pattern: ^0^4...  (which means that the first digit can't be a 0 or a 4)

HTH.

Regards,

Bill

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

Community Member

Re: Interesting destination-pattern regex puzzle

Perfect Answer!!!

Thanks a lot, Bill !!!

Cheers,

Bala.

Re: Interesting destination-pattern regex puzzle

No problem.  Glad to be of assistance.

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

1167
Views
9
Helpful
5
Replies
CreatePlease to create content