Interesting destination-pattern regex puzzle

Answered Question
Apr 6th, 2010

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.

Correct Answer by William Bell about 6 years 10 months ago

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

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.5 (3 ratings)
Loading.
balasundaram.k_2 Wed, 04/07/2010 - 01:18

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.

Correct Answer
William Bell Wed, 04/07/2010 - 06:32

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

Actions

This Discussion