RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Phone Numbers
Expression
^(\d)(\s)(\d)*(-)(\d)*(-)(\d)*
Description
Matches any number following the 1 800 phone method. It's not 100% foolproof so please be wary - just wanted to present my legitimate, raw regex without having to look up anything on Stack Overflow. Thank you. Link to my GitHub: https://github.com/StoddardSpencer96
Matches
1 902-444-444 1 904-565-5555 1 419-444-4444 1 902-44-3333 (this one shouldnt match)
Non-Matches
23 904-5555-5555 1 902-44-3333 (this is where the number should be)
Author Rating: Not yet rated. Spencer Stoddard
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials