Regular Expressions (RegEx)

  • Thread starter Thread starter chris fellows
  • Start date Start date
C

chris fellows

My DotNet component needs to parse a phone number and check that it is in
the range 01234560020 to 01234562500. It needs to be done using a Regular
Expression. (Please don't ask why!!!) Please can someone help me out?
 
My DotNet component needs to parse a phone number and check that it is in
the range 01234560020 to 01234562500. It needs to be done using a Regular
Expression. (Please don't ask why!!!) Please can someone help me out?

Hi Chris,

I don't know how phone number looks like.
Here's expression that matches numbers inbetween 01234560020,
01234562500

0123456(?:(?:00[2-9]\d)|(?:0[1-9]\d\d)|(?:1\d{3})|(?:2[0-4]\d{2})|(?:
2500))

Thanks,
Sergey
 
Assuming that you can remove all non-numeric characters from the number,
just parse it as an integer and check the range using < and >.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
 
Back
Top