Title |
Test
Find
Pattern Title
|
Expression |
^([\(]{1}[0-9]{3}[\)]{1}[\.| |\-]{0,1}|^[0-9]{3}[\.|\-| ]?)?[0-9]{3}(\.|\-| )?[0-9]{4}$ |
Description |
More permissive than others on the site, this one allows you to let a user enter US phone numbers in the way they most commonly use, without letting them enter non-valid combinations. |
Matches |
5551212 | 614555-1212 | (614)555-1212 |
Non-Matches |
A12-5555 | (614-555-1212 | 555*1212 |
Author |
Rating:
Jeff Gabriel
|
Source |
a modification of one submitted by 'gabe g' |
Your Rating |
|
Title: Incorrect syntax.
Name: g1smd
Date: 8/5/2012 1:01:58 PM
Comment:
The [\(]{1} simplifies to \( here.
The [\)]{1} simplifies to \) here. When there's only one character, there's no need to use character group syntax. Additionally, the {1} is completely redundant.
The [\.| |\-]{0,1} simplifies to [\s.-]? here.
The [\.|\-| ]? simplifies to [\s.-]? here. Using pipes within a character group is completely incorrect.
Title: add in other commons
Name: Mike
Date: 10/9/2003 2:57:18 PM
Comment:
You could also add in other commons such as:
000-000-0000