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 4 of 6 pages; Items 61 to 80
Title Test Details Validate US Postal Code
Expression
^(?!00000)(?<zip>(?<zip5>\d{5})(?:[ -](?=\d))?(?<zip4>\d{4})?)$
Description
Validate US zip codes. Matches all zip codes of exactly 5 digits except 00000. Optionally, matches zip5+zip4 where zip5 is exactly 5 digits, zip4 is exactly 4 digits, and zip5 and zip4 are, optionally, separated by a single space or hyphen. Captures zip5 and zip4 to named groups to facilitate program manipulation.
Matches
12345 | 123456789 | 12345-6789
Non-Matches
12345- | 00000 | 00000-6789
Author Rating: Not yet rated. Jerry Schmersahl
Title Test Details Pattern Title
Expression
(?<zip5>^\d{5})([\- ]?(?<plus4>\d{4})?$)
Description
Zip Code (Zip or Zip-Plus4 format). Accepts a hyphen, a space, or nothing between Zip and Plus4 segments. Named segments &lt;zip&gt; and &lt;plus4&gt; may be used to reformat users input to desired format using Regex replace function (re.replace).
Matches
92078 | 92078-4705 | 92078-4705
Non-Matches
9207 | 92078470 | 92078*4705
Author Rating: Not yet rated. MARK J KRISBURG
Title Test Details Pattern Title
Expression
^(1?(-?\d{3})-?)?(\d{3})(-?\d{4})$
Description
US Telephone Reg expression that allows 7, 10 or 11 digits with or without hyphens.
Matches
15615552323 | 1-561-555-1212 | 5613333
Non-Matches
1-555-5555 | 15553333 | 0-561-555-1212
Author Rating: Not yet rated. jay gann
Title Test Details Pattern Title
Expression
^\(?(?<AreaCode>[2-9]\d{2})(\)?)(-|.|\s)?(?<Prefix>[1-9]\d{2})(-|.|\s)?(?<Suffix>\d{4})$
Description
US telephone number with area code. Validates and also captures AreaCode, Prefix and Suffix for reformatting.
Matches
(213) 343-1234 | 213-343-1234 | 213 343 1234
Non-Matches
343-1234
Author Rating: Not yet rated. MARK J KRISBURG
Title Test Details Pattern Title
Expression
^([0-9]{5})([\-]{1}[0-9]{4})?$
Description
Validates against a U.S. postal code in either a 5 digit format or a 5 dash 4 format.
Matches
18017 | 18017-1401
Non-Matches
1801A | 18017- | 18017-152A
Author Rating: Not yet rated. Jeff Johns
Title Test Details Pattern Title
Expression
^[A-Za-z]{1,2}[0-9A-Za-z]{1,2}[ ]?[0-9]{0,1}[A-Za-z]{2}$
Description
This regular expression can be used to validate UK postcodes. Especially useful if want to provide a client side validation on a web site.
Matches
SW112LE | SW11 2LE | CR05LE
Non-Matches
12CR0LE | 12CR 0LE | SWLE05
Author Rating: Not yet rated. Santosh Potadar
Title Test Details Pattern Title
Expression
([0]{1}[6]{1}[-\s]*[1-9]{1}[\s]*([0-9]{1}[\s]*){7})|([0]{1}[1-9]{1}[0-9]{1}[0-9]{1}[-\s]*[1-9]{1}[\s]*([0-9]{1}[\s]*){5})|([0]{1}[1-9]{1}[0-9]{1}[-\s]*[1-9]{1}[\s]*([0-9]{1}[\s]*){6})
Description
Meets dutch phone number requirements.. One posted here before didn't allow the 0 after the first digit of the call ID (so the second number or later after the prefix), which should be allowed. I modified that one to meet full requirements now.. Enjoy!!
Matches
06 12345678 | 010-1234560 | 0111-101234
Non-Matches
05-43021212 | 123-4567890 | 1234567890
Author Rating: Not yet rated. Dennis de Jong
Title Test Details Pattern Title
Expression
^(9,)*([1-9]\d{2}-?)*[1-9]\d{2}-?\d{4}$
Description
Validates US or Canadian phone numbers with the use of &quot;-&quot; or numbers stuck together. No parantheses allowed as well as spaces. Area code is optional. The &quot;9,&quot; is optional as well, which on some phone systems is needed to dial out.
Matches
9,5143393044 | 9,514-339-3044 | 339-3044
Non-Matches
9,339 3044 | 514 440 2009 | (514) 440-2009
Author Rating: Not yet rated. Max Cacchiotti
Title Test Details Pattern Title
Expression
^[abceghjklmnprstvxyABCEGHJKLMNPRSTVXY][0-9][abceghjklmnprstvwxyzABCEGHJKLMNPRSTVWXYZ] {0,1}[0-9][abceghjklmnprstvwxyzABCEGHJKLMNPRSTVWXYZ][0-9]$
Description
Canadian Postal Code / Codes / Canada / Zip Google for DFIOQU and you'll see where I got the info for this. Can anyone simplify this?
Matches
G3M 5T9 | C3M5T9
Non-Matches
Z3M 5T9 | W3M 5T9 | 5T9 C3M
Author Rating: Not yet rated. W. D.
Title Test Details Pattern Title
Expression
^([\+][0-9]{1,3}[\.][0-9]{1,12})([x]?[0-9]{1,4}?)$
Description
Validates on the following standards: +CCC.ZZZZZZZZZZxYYYY, where 'C' is the numeric country phone code (up to three digits), 'Z' is the phone number (up to 12 digits) and 'Y' is the extension (up to 4 digits); max length overall is 20 characters, including the '+', '.', and 'x' (if extension is present). Useful for people communicating with the OpenSRS API
Matches
+800.4453377x4444 | +80.4453377 | +8.123456789123x1111
Non-Matches
181823884499 | +800.4453377x | 2486994x11
Author Rating: Not yet rated. Hayk A
Title Test Details Pattern Title
Expression
^[S-s]( |-)?[1-9]{1}[0-9]{2}( |-)?[0-9]{2}$
Description
Swedish postcodes (as far as i know)
Matches
S-123 45 | s 123 45 | S123-45
Non-Matches
Se12345
Author Rating: Not yet rated. paul Snabilie
Title Test Details Pattern Title
Expression
^[a-zA-Z\d]+(([\'\,\.\- #][a-zA-Z\d ])?[a-zA-Z\d]*[\.]*)*$
Description
Address It has now been enhanced to accept # too!!
Matches
393 12th St. City, State Zip code
Non-Matches
12 street @@@
Author Rating: Not yet rated. Sadaf Ahmed
Title Test Details Pattern Title
Expression
(\d{4,6})
Description
Simple Postcode - this is the first test of the new WebService :-)
Matches
4078 | 539999
Non-Matches
dfasdf | afasdfsad
Author Rating: Not yet rated. Darren Neimke
Title Test Details Pattern Title
Expression
^([+]39)?((38[{8,9}|0])|(34[{7-9}|0])|(36[6|8|0])|(33[{3-9}|0])|(32[{8,9}]))([\d]{7})$
Description
Validates a Italian mobile phone number with (or without) the International code
Matches
+393471234567 | 3381234567
Non-Matches
+39 3401234567 | 347 1234567 | 338-1234567
Author Rating: Not yet rated. Fabrizio Fortini
Title Test Details Pattern Title
Expression
^[01]?[- .]?\(?[2-9]\d{2}\)?[- .]?\d{3}[- .]?\d{4}$
Description
U. S. or Canadian telephone number regular expression. &lt;BR&gt; &lt;BR&gt; // # Checks phone numbers for validity &lt;BR&gt; // [01]? # optional '0', or '1' &lt;BR&gt; // [- .]? # optional separator is either a dash, a space, or a period. &lt;BR&gt; // \(? # optional parentheses &lt;BR&gt; // [2-9] # first # of the area code must not be a '0' or '1' &lt;BR&gt; // \d{2} # next 2 digits of area code can be 0-9 &lt;BR&gt; // \)? # optional parentheses &lt;BR&gt; // [- .]? # optional separator is either a dash, a space, or a period. &lt;BR&gt; // \d{3} # 3-digit prefix &lt;BR&gt; // [- .]? # optional separator is either a dash, a space, or a period. &lt;BR&gt; // \d{4} # 4-digit station number &lt;BR&gt;
Matches
18008793262 | 800-879-3262 | 0-800.879.3262
Non-Matches
879 3262 | 077 879 3262 | 879-3262
Author Rating: Not yet rated. W. D.
Title Test Details Pattern Title
Expression
^[A-Za-z]{1,2}[\d]{1,2}([A-Za-z])?\s?[\d][A-Za-z]{2}$
Description
UK Postal Codes - The code is normally written in capital letters with a space between the outer and inner parts; it is understandable if the space is omitted. This regular expression validates upper or lower case with or without the space:
Matches
CF1 2AA | cf564fg
Non-Matches
a1234d | A12 77Y
Author Rating: Not yet rated. Scott Pite
Title Test Details Pattern Title
Expression
^[+][0-9]\d{2}-\d{3}-\d{4}$
Description
This is a basic telephone number vaildation which needs a compulsory prefix of a '+' sign with three digits and followed by a hipen, another three digits and finally followed by another hipen and four more digits. Regards, Senthil Gunabalan
Matches
+974-584-5656 | +000-000-0000 | +323-343-3453
Non-Matches
974-584-5656 | +974 000 0000
Author Rating: Not yet rated. Senthil Gunabalan
Title Test Details U.S. Street Address
Expression
^(?n:(?<address1>(\d{1,5}(\ 1\/[234])?(\x20[A-Z]([a-z])+)+ )|(P\.O\.\ Box\ \d{1,5}))\s{1,2}(?i:(?<address2>(((APT|B LDG|DEPT|FL|HNGR|LOT|PIER|RM|S(LIP|PC|T(E|OP))|TRLR|UNIT)\x20\w{1,5})|(BSMT|FRNT|LBBY|LOWR|OFC|PH|REAR|SIDE|UPPR)\.?)\s{1,2})?)(?<city>[A-Z]([a-z])+(\.?)(\x20[A-Z]([a-z])+){0,2})\, \x20(?<state>A[LKSZRAP]|C[AOT]|D[EC]|F[LM]|G[AU]|HI|I[ADL N]|K[SY]|LA|M[ADEHINOPST]|N[CDEHJMVY]|O[HKR]|P[ARW]|RI|S[CD] |T[NX]|UT|V[AIT]|W[AIVY])\x20(?<zipcode>(?!0{5})\d{5}(-\d {4})?))$
Description
captures US street address. Address format: ##### Street 2ndunit City, ST zip+4 address1 - must have street number and proper case street name. no punctuation or P.O Box #### punctuation manditory for P.O. address2 - optional secondary unit abbr. Secondary range required for some units. City - Proper case city name. State - State abbreviation. All caps zip - zip+4. Can't be all zeroes Abbreviations for secondary units and States are those used by the US Postal Service. http://www.usps.com/ncsc/lookups/usps_abbreviations.html Certain secondary units require a secondary range, see the above link THis RE isn't unbreakable, Probably will allow some false positives but should work for most addresses.
Matches
123 Park Ave Apt 123 New York City, NY 10002 | P.O. Box 12345 Los Angeles, CA 12304
Non-Matches
123 Main St | 123 City, State 00000 | 123 street city, ST 00000
Author Rating: Not yet rated. Michael Ash
Title Test Details Pattern Title
Expression
^(\(?\d\d\d\)?)?( |-|\.)?\d\d\d( |-|\.)?\d{4,4}(( |-|\.)?[ext\.]+ ?\d+)?$
Description
Basic US phone number matching pattern. I found this place and used a regex, so figured I'd share.
Matches
(888) 555-1212 | 888.555.1212 | (888) 555.1212 ext. 1212
Non-Matches
(800) got-fish | 011+ 78907 2344323
Author Rating: Not yet rated. Jon Stephens
Title Test Details Pattern Title
Expression
^p(ost)?[ |\.]*o(ffice)?[ |\.]*(box)?[ 0-9]*[^[a-z ]]*
Description
This expression is useful for determining if an address is a PO Box type address. This can be useful in shipping systems as well as other systems that need to make determinations based on the type of address imputed.
Matches
po box 4353
Non-Matches
pollo St. | P. O. Box d3f12s | BOX 23
Author Rating: Not yet rated. Darryl Kuhn
Change page:   |    Displaying page 4 of 6 pages; Items 61 to 80

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