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

Please support RegExLib Sponsors

Sponsors

Browse Expressions by Category

104 regular expressions found in this category!

Expressions in category: Address/Phone

Change page:   |    Displaying page 6 of 6 pages; Items 101 to 104
Title Test Details Pattern Title
Expression
^(\()?(787|939)(\)|-)?([0-9]{3})(-)?([0-9]{4}|[0-9]{4})$
Description
Filter US telephone numbers. This particular one accepts only area code 939 or 787. Area code parentesis or hyphens optional.
Matches
(787)755-0114 | 939-315-0112 | 7879093849
Non-Matches
(098)737-3942 | (89)893-2392 | 939782721
Author Rating: Not yet rated. Ricardo Gonzalez
Title Test Details Pattern Title
Expression
(\+)?([-\._\(\) ]?[\d]{3,20}[-\._\(\) ]?){2,10}
Description
Telephone number filter - use to catch and replace phone numbers where you don't want them to appear.
Matches
(604) 789-0136 | +123-45678-908
Non-Matches
01.12.23
Author Rating: Not yet rated. Dave Turner
Title Test Details Pattern Title
Expression
\d{5}\-\d{3}
Description
Brazilian Postal Box RegExp validation
Matches
02245-999
Non-Matches
ABCDE-FGH
Author Rating: Not yet rated. Valmir Cinquini
Title Test Details Pattern Title
Expression
^(?:(?<1>[(])?(?<AreaCode>[2-9]\d{2})(?(1)[)][ ]?|[- \/.]?))? (?<Prefix>[1-9]\d{2})[- .]?(?<Suffix>\d{4}) (?:(?:[ ]+|[xX]|Ext\.?[ ]?){1,2}(?<Ext>\d{1,5}))?$
Description
PCRE (PHP) regular expression for validating US telephone numbers with OPTIONAL area code, and OPTIONAL extension. Promiscuous formatting (parenthesis or slash, space, dash, dot or no separator). Captures the telephone number area code, prefix, suffix, and extension to named groups. Rejects area codes that begin with 0 or 1 and prefixes that begin with 0. Rejects all telephone numbers that do not match on exactly 7 digits, or on exactly 10 digits with the optional area code, not counting the extension or the format. Seperators, when used, must be in the right place. Extension can be preceded by a space(s) and/or "x", "X", or "Ext" and matches on 1 to 5 digits. Written from the view that getting phone numbers from customers should be as easy and tolerant as possible. Matched number can be parsed and entered into database correctly on the business end. Based on similar regex by Jerry Schmersahl in this library. Case insensitivity could simplify this expression, but implementation is left up to you. For PHP/PCRE compatibility, put a "P" in front of each capture name (ie: "(?P<AreaCode>"). This server does not recognize the Python/PCRE naming convention.
Matches
785/3215564x51337 | (785)321-5564 Ext. 51337 | 321.5564 x5
Non-Matches
785321556 | (785)321-5564 x | 7853 215567
Author Rating: Not yet rated. Bret Greenwood
Change page:   |    Displaying page 6 of 6 pages; Items 101 to 104

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