Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^(?!\d[1]{2}|[5]{3})([2-9]\d{2})([. -]*)\d{4}$
|
Description |
Validates *usable* US telephone numbers (possibly Canadian and Caribbean Islands as well?) Numbers cannot beginning with zero, one, (any number)11, or 555. It will allow either a hyphen, space or period as a separator.
Technically (and contrary to popular belief) most 555- numbers ARE valid numbers [see http://www.nanpa.com/nas/public/form555MasterReport.do?method=display555MasterReport ] but they are unlikely to be used by normal folks. Therefore, excluding them with this regex is useful to prevent bogus/fraudulent telephone numbers in forms.
FYI, the fictitious 555- numbers used in the movies and TV are only in the range of 555-0100 through 555-0199. Not very many, huh?
|
Matches |
222-2222 | 295-5000
|
Non-Matches |
555-1234 | 411-5555 | 099-9999
|
Author |
Rating:
Not yet rated.
JP Honeywell
|
Displaying page
of
pages;
Items to