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
^(?:\([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
(((^[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
^\(\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
^\d{5}((-|\s)?\d{4})?$
Description
Single field zip code validator, useful for Web Forms. Allows user to enter 5-digit or 5-digit plus 4 zip code, with hyphen or space or NO space between last 4 digits.
Matches
92078-4705 | 920784705 | 92078 4705
Non-Matches
9027x | 902 | 92078.4705
Author Rating: The rating for this expression. MARK J KRISBURG
Title Test Details State Codes
Expression
^(?-i:A[LKSZRAEP]|C[AOT]|D[EC]|F[LM]|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEHINOPST]|N[CDEHJMVY]|O[HKR]|P[ARW]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$
Description
The RE match U.S. state abbreviation used by the U.S. Post Office.
Matches
AL | CA | AA
Non-Matches
New York | California | ny
Author Rating: The rating for this expression. Michael Ash
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
Title Test Details Pattern Title
Expression
^(?<national>\+?(?:86)?)(?<separator>\s?-?)(?<phone>(?<vender>13[0-4])(?<area>\d{4})(?<id>\d{4}))$
Description
Just test in C#. Validates a China Unicom mobile phone number with (or without) the International code.
Matches
+8613012345678 | 86 13012345678 | 13245679087
Non-Matches
+86130123456781231434352 | 13560012513 | ++8613012345678
Author Rating: The rating for this expression. Evan Tao
Title Test Details Pattern Title
Expression
^(([A-Z]{1,2}[0-9]{1,2})|([A-Z]{1,2}[0-9][A-Z]))\s?([0-9][A-Z]{2})$
Description
Matches UK postcodes of the below formats. The space is optional. AN NAA AAN NAA ANN NAA ANA NAA AANA NAA AANN NAA
Matches
A11AA | AA1A 1AA | AA11 1AA
Non-Matches
AAA 1AA | AA11A 1AA | AAA1AA
Author Rating: The rating for this expression. Phil A
Title Test Details Phone Numbers
Expression
^(1\s*[-\/\.]?)?(\((\d{3})\)|(\d{3}))\s*[-\/\.]?\s*(\d{3})\s*[-\/\.]?\s*(\d{4})\s*(([xX]|[eE][xX][tT])\.?\s*(\d+))*$
Description
This regular expressions matches phone numbers with area codes and optional US country code and optional phone extension. User have so many ways of entering phone numbers into input fields. This allows for some of the ones I've encountered. Feel free to contact me if you find ones that do not match.
Matches
2405525009 | 1(240) 652-5009 | 240/752-5009 ext.55
Non-Matches
(2405525009 | 2 (240) 652-5009
Author Rating: The rating for this expression. Dean Dal Bozzo
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
^(\+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-9]{6}
Description
I know its simple, yet there was no Russian postal code regular expression on the RegExLib. Just in case some needs to know the format.
Matches
150016
Non-Matches
qqww
Author Rating: The rating for this expression. Roman Lukyanenko
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
^[\(]? ([^0-1]){1}([0-9]){2}([-,\),/,\.])*([ ])?([^0-1]){1}([0-9]){2}[ ]?[-]?[/]?[\.]? ([0-9]){4}$
Description
Here is a regular expression I wrote that validates U.S. phone numbers with area codes. You can't have a leading '0' or '1' but you can separate the number blocks with a space, a dot, a slash, or a hyphen. It also prevents a '0' or '1' for the first digit of the prefix. No extension is allowed and it must be 10 digits.
Matches
(713) 555-1212 | 713/555/1212 | 713.555 1212
Non-Matches
07135551212 | 7130125551212
Author Rating: The rating for this expression. Bruce Hatherly
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: The rating for this expression. Fabrizio Fortini
Title Test Details Pattern Title
Expression
^(?:(?:[\+]?(?<CountryCode>[\d]{1,3}(?:[ ]+|[\-.])))?[(]?(?<AreaCode>[\d]{3})[\-/)]?(?:[ ]+)?)?(?<Number>[a-zA-Z2-9][a-zA-Z0-9 \-.]{6,})(?:(?:[ ]+|[xX]|(i:ext[\.]?)){1,2}(?<Ext>[\d]{1,5}))?$
Description
This allows the formatting of most phone numbers.
Matches
1-800-DISCOVER | (610) 310-5555 x5555 | 533-1123
Non-Matches
1 533-1123 | 553334 | 66/12343
Author Rating: The rating for this expression. Nicholas Berardi
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
^((\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
(((^[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
Change page:   |    Displaying page 1 of 6 pages; Items 1 to 20

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