Regular Expression- Range (telephone)

Hi,

I need a regular expression code that identifies number between 8003966101 and 8003966150. Can someone help me with this?

Thanks.
ezzadinAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Terry WoodsConnect With a Mentor IT GuruCommented:
Can you save your test data there and provide a link? The "g" pattern modifier would normally cause multiple occurrences to be matched, ie
/80039661(0[1-9]|[1-4]\d|50)/g

Open in new window

but it looks like the tool at your given link may use that pattern modifier by default. It seems to work for me:
http://regexr.com/3efmc
0
 
Terry WoodsIT GuruCommented:
Pattern:
/80039661(0[1-9]|[1-4]\d|50)/

Open in new window


Depending on the language, the \ character may need escaping, and the pattern delimiters / may or may not need to be there.
0
 
ezzadinAuthor Commented:
Hi Terry,

Thanks. I tested the Regex using regexr.com and I'm only getting one match though.
0
 
ezzadinAuthor Commented:
I see. This is working great. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.