Regular Expression- Range (telephone)

Posted on 2016-10-19
Last Modified: 2016-10-19

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

Question by:ezzadin
  • 2
  • 2
LVL 35

Expert Comment

by:Terry Woods
ID: 41851132

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.

Author Comment

ID: 41851185
Hi Terry,

Thanks. I tested the Regex using and I'm only getting one match though.
LVL 35

Accepted Solution

Terry Woods earned 500 total points
ID: 41851308
Can you save your test data there and provide a link? The "g" pattern modifier would normally cause multiple occurrences to be matched, ie

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:

Author Comment

ID: 41851311
I see. This is working great. Thanks.

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been reconstructing a PHP-based application that has grown into a full blown interface system over the last ten years by a developer that has now gone into business for himself building websites. I am not incredibly fond of writing PHP code o…
As most anyone who uses or has come across them can attest to, regular expressions (regex) are a complicated bit of magic. Packed so succinctly within their cryptic syntax lies a great deal of power. It's not the "take over the world" kind of power,…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question