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 1 of 6 pages; Items 1 to 20
Title Test Details Pattern Title
Expression
^(\d{5}-\d{4}|\d{5})$|^([a-zA-Z]\d[a-zA-Z] \d[a-zA-Z]\d)$
Description
This is a modification of the zip code regular expression submitted by Steven Smith ([email protected]) It no longer matches 78754-12aA
Matches
78754 | 78754-1234 | G3H 6A3
Non-Matches
78754-12aA | 7875A | g3h6a3
Author Rating: The rating for this expression. Khoi Pham
Title Test Details Pattern Title
Expression
(^1300\d{6}$)|(^1800|1900|1902\d{6}$)|(^0[2|3|7|8]{1}[0-9]{8}$)|(^13\d{4}$)|(^04\d{2,3}\d{6}$)
Description
Australian phone numbers: Matches all known formats incl normal 10-digit landline numbers (valid area code mandatory) 13, 1300, 1800, 1900, 1902 plus mobile 10 and 11-digit formats. Use a Replace function first to remove non-numerics which are probably separators (E.g. newNum = number.replace(/[\D]/g, ""). Please contact me if you find any valid Aussie numbers being rejected.
Matches
0732105432 | 1300333444 | 131313
Non-Matches
32105432 | 13000456
Author Rating: The rating for this expression. Bill Hely
Title Test Details Pattern Title
Expression
^((\d{5}-\d{4})|(\d{5})|([A-Z]\d[A-Z]\s\d[A-Z]\d))$
Description
This expression matches three different formats of postal codes: 5 digit US ZIP code, 5 digit US ZIP code + 4, and 6 digit alphanumeric Canadian Postal Code. The first one must be 5 numeric digits. The ZIP+4 must be 5 numeric digits, a hyphen, and then 4 numeric digits. The Canadian postal code must be of the form ANA NAN where A is any uppercase alphabetic character and N is a numeric digit from 0 to 9.
Matches
44240 | 44240-5555 | T2P 3C7
Non-Matches
44240ddd | t44240-55 | t2p3c7
Author Rating: The rating for this expression. Qing Jiang
Title Test Details Pattern Title
Expression
^([\(]{1}[0-9]{3}[\)]{1}[ ]{1}[0-9]{3}[\-]{1}[0-9]{4})$
Description
It is the exact phone number regular expression for '(###) ###-####'. Written by Jason Gaylord.
Matches
(555) 555-1212
Non-Matches
555-1212 | 1-800-555-1212 | 555-555-1212
Author Rating: The rating for this expression. Jason N. Gaylord
Title Test Details Pattern Title
Expression
^[0-9]{5}([- /]?[0-9]{4})?$
Description
US Zip Code + 4 digit extension Postal Code
Matches
14467 | 144679554 | 14467-9554
Non-Matches
14467 955 | 14467- | 1446-9554
Author Rating: The rating for this expression. Chris Weidert
Title Test Details Pattern Title
Expression
^[2-9]\d{2}-\d{3}-\d{4}$
Description
This expression matches a hyphen separated US phone number, of the form ANN-NNN-NNNN, where A is between 2 and 9 and N is between 0 and 9.
Matches
800-555-5555 | 333-444-5555 | 212-666-1234
Non-Matches
000-000-0000 | 123-456-7890 | 2126661234
Author Rating: The rating for this expression. Steven Smith
Title Test Details Pattern Title
Expression
^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-?|\ ?))[2-9]\d{2}[- ]?\d{4}$
Description
US Phone Number: This regular expression for US phone numbers conforms to NANP A-digit and D-digit requirments (ANN-DNN-NNNN). Area Codes 001-199 are not permitted; Central Office Codes 001-199 are not permitted. Format validation accepts 10-digits without delimiters, optional parens on area code, and optional spaces or dashes between area code, central office code and station code. Acceptable formats include 2225551212, 222 555 1212, 222-555-1212, (222) 555 1212, (222) 555-1212, etc. You can add/remove formatting options to meet your needs.
Matches
5305551212 | (530) 555-1212 | 530-555-1212
Non-Matches
0010011212 | 1991991212 | 123) not-good
Author Rating: The rating for this expression. Don Johnston
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: The rating for this expression. Dennis de Jong
Title Test Details 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: The rating for this expression. Jeff Gabriel
Title Test Details Pattern Title
Expression
^((\d{5}-\d{4})|(\d{5})|([AaBbCcEeGgHhJjKkLlMmNnPpRrSsTtVvXxYy]\d[A-Za-z]\s?\d[A-Za-z]\d))$
Description
Regular expression for US (ZIP and ZIP+4) and Canadian postal codes. It allows 5 digits for the first US postal code and requires that the +4, if it exists, is four digits long. Canadain postal codes can contain a space and take form of A1A 1A1. The letters can be upper or lower case, but the first letter must be one of the standard Canadian zones: A,B,C,E,G,H,J,K,L,M,N,P,R,S,T,V,X,Y.
Matches
00501 | 84118-3423 | n3a 3B7
Non-Matches
501-342 | 123324 | Q4B 5C5
Author Rating: The rating for this expression. Matthew Aznoe
Title Test Details Pattern Title
Expression
^\s*\(?(020[7,8]{1}\)?[ ]?[1-9]{1}[0-9{2}[ ]?[0-9]{4})|(0[1-8]{1}[0-9]{3}\)?[ ]?[1-9]{1}[0-9]{2}[ ]?[0-9]{3})\s*$
Description
Matches UK phone numbers - London and regional. It started off with something fairly short posted by liljim at www.forums.devshed.com but I wanted a little more precision to weed out all the zeros. Now it also weeds out premium phone numbers (as of 19/12/03).
Matches
02071111111 | 01000100000
Non-Matches
00000000000
Author Rating: The rating for this expression. M h
Title Test Details Pattern Title
Expression
^\(\d{3}\) ?\d{3}( |-)?\d{4}|^\d{3}( |-)?\d{3}( |-)?\d{4}
Description
Expresion Regular para Teléfonos con clave lada en México separada o no con guiones o espacios. Sirve para teléfonos estacionarios y/o celulares, con o sin paréntesis, 10 números a fuerzas, funciona en .net
Matches
(658)154-1122 | 6581541122 | 658-154-1122
Non-Matches
(658 154 1122 | 759-1245 | 875 (489 1568)
Author Rating: The rating for this expression. Alex Cons
Title Test Details Pattern Title
Expression
^([0-9]( |-)?)?(\(?[0-9]{3}\)?|[0-9]{3})( |-)?([0-9]{3}( |-)?[0-9]{4}|[a-zA-Z0-9]{7})$
Description
Matches US phone number format. 1 in the beginning is optional, area code is required, spaces or dashes can be used as optional divider between number groups. Also alphanumeric format is allowed after area code.
Matches
1-(123)-123-1234 | 123 123 1234 | 1-800-ALPHNUM
Non-Matches
1.123.123.1234 | (123)-1234-123 | 123-1234
Author Rating: The rating for this expression. Igor Kravtsov
Title Test Details Pattern Title
Expression
(((^[BEGLMNS][1-9]\d?) | (^W[2-9] ) | ( ^( A[BL] | B[ABDHLNRST] | C[ABFHMORTVW] | D[ADEGHLNTY] | E[HNX] | F[KY] | G[LUY] | H[ADGPRSUX] | I[GMPV] | JE | K[ATWY] | L[ADELNSU] | M[EKL] | N[EGNPRW] | O[LX] | P[AEHLOR] | R[GHM] | S[AEGKL-PRSTWY] | T[ADFNQRSW] | UB | W[ADFNRSV] | YO | ZE ) \d\d?) | (^W1[A-HJKSTUW0-9]) | (( (^WC[1-2]) | (^EC[1-4]) | (^SW1) ) [ABEHMNPRVWXY] ) ) (\s*)? ([0-9][ABD-HJLNP-UW-Z]{2})) | (^GIR\s?0AA)
Description
Here it is, the monster UK Postcode regular expression that should prevent the majority of miskeying. Unlike an most other regexes it only permits valid combinations of letters, e.g. BN works, BM does not. Spaces between the first and second parts are optional. I have tested this against a file of 7,500 valid postcodes, and also against a real-world list of about 12,000 which had some bad data. Manually checking a sample of the rejected ones showed it was working correctly (and how poor the data was!!). I originally started by trying to adapt the GDSC document at http://www.govtalk.gov.uk/gdsc/html/frames/PostCode.htm and specifically their XSD pattern at http://www.govtalk.gov.uk/gdsc/schemaHtml/bs7666-v2-0-xsd-PostCodeType.htm but this turned out to be rather loose. Instead I wrote this. If you find any valid postcodes being rejected by this regex please let me know.
Matches
W1A 1AA | EC2V 1JN | GIR 0AA
Non-Matches
TB12 1AB | EC2V 1JM | W2A 1AA
Author Rating: The rating for this expression. Howard Richards
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: The rating for this expression. Santosh Potadar
Title Test Details Pattern Title
Expression
((\(\d{3,4}\)|\d{3,4}-)\d{4,9}(-\d{1,5}|\d{0}))|(\d{4,12})
Description
telphone number check.
Matches
0833-1234567-8888 | (0833)1234567-8888 | 12345678
Non-Matches
ceocio | !@$@#$
Author Rating: The rating for this expression. Liu Wei
Title Test Details Pattern Title
Expression
^(\+97[\s]{0,1}[\-]{0,1}[\s]{0,1}1|0)50[\s]{0,1}[\-]{0,1}[\s]{0,1}[1-9]{1}[0-9]{6}$
Description
regex which matches UAE mobile phone numbers. Its capable to take inputs +97150 3827741, +97-150-3827741, +97150 - 3827741,050 3827741, 050 - 3827741 Enjoy REGEXXXXXXX!!!!!!!
Matches
+97150 3827741 | 0503827741 | 050-3827741
Non-Matches
040 3827741 | 05 3827741 | 050_______spaces_______3827741
Author Rating: The rating for this expression. Vathachira Joseph Bino
Title Test Details Pattern Title
Expression
^0[234679]{1}[\s]{0,1}[\-]{0,1}[\s]{0,1}[1-9]{1}[0-9]{6}$
Description
The regex matches the UAE land phone numbers. Checks the area codes[04,02,06...etc] strictly. Force user to input phone numbers in strict manner(it take input 04 3452488, but not 04______spaces_______3452488)
Matches
04 3452488 | 04 -3452488 | 04 - 3452499
Non-Matches
01 -3452488 | 04 34524888 | 08 3452488
Author Rating: The rating for this expression. Vathachira Joseph Bino
Title Test Details Pattern Title
Expression
(((^[BEGLMNS][1-9]\d?)|(^W[2-9])|(^(A[BL]|B[ABDHLNRST]|C[ABFHMORTVW]|D[ADEGHLNTY]|E[HNX]|F[KY]|G[LUY]|H[ADGPRSUX]|I[GMPV]|JE|K[ATWY]|L[ADELNSU]|M[EKL]|N[EGNPRW]|O[LX]|P[AEHLOR]|R[GHM]|S[AEGKL-PRSTWY]|T[ADFNQRSW]|UB|W[ADFNRSV]|YO|ZE)\d\d?)|(^W1[A-HJKSTUW0-9])|(((^WC[1-2])|(^EC[1-4])|(^SW1))[ABEHMNPRVWXY]))(\s*)?([0-9][ABD-HJLNP-UW-Z]{2}))$|(^GIR\s?0AA$)
Description
For the terminally hard of thinking, a version of my UK postcode validator without WHITESPACE. Unlike most validators on regexlib, this knows valid postcode combinations, e.g. W1A is permitted, W1 is not, but W2 is. It should catch between 95-98% of invalid postcodes.
Matches
W1A 1AA | EC1V1JN | N7 8BQ
Non-Matches
W1A 1AM | BM1 1AB | EC1 1AA
Author Rating: The rating for this expression. Howard Richards
Title Test Details Pattern Title
Expression
^(\([2-9]|[2-9])(\d{2}|\d{2}\))(-|.|\s)?\d{3}(-|.|\s)?\d{4}$
Description
Telephone validator allowing user to enter 10 digit telephone number with segments of number separated by hyphens, periods or spaces. Also braces allowed around area code.
Matches
213-123-1234 | 2131231234 | (213) 123-1234
Non-Matches
123-123-1234
Author Rating: The rating for this expression. MARK J KRISBURG
Change page:   |    Displaying page 1 of 6 pages; Items 1 to 20

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