104 regular expressions found in this category!
Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^\d{5}-\d{4}|\d{5}|[A-Z]\d[A-Z] \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 | G3H 6A3 |
Non-Matches |
Ohio | abc | g3h6a3 |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^[a-zA-Z]{1}[0-9]{1}[a-zA-Z]{1}(\-| |){1}[0-9]{1}[a-zA-Z]{1}[0-9]{1}$ |
Description |
This expression will help match Quebec's postal codes. |
Matches |
h2j-3c4 | H2J 3C4 | H2J-3c4 |
Non-Matches |
H2J_3C4 | H213C4 | 123456 |
Author |
Rating:
Frederic Trudeau
|
Title |
Test
Details
Pattern Title
|
Expression |
(02\d\s?\d{4}\s?\d{4})|(01\d{2}\s?\d{3}\s?\d{4})|(01\d{3}\s?\d{5,6})|(01\d{4}\s?\d{4,5}) |
Description |
Validates UK domestic landline phone numbers.
Valid formats are:
029 99999999 or 029 9999 9999; 0199 9999999 or 0199 999 9999; 01999 99999; 01999 999999; 019999 9999; 019999 99999. These formats are taken from the official guidelines from Ofcom, the organisation responsible for UK telecoms issues. Brackets are not valid and STD code must be entered. |
Matches |
020 1234 5678 | 0123 4567890 | 01234 456789 |
Non-Matches |
02476 123456 | 0845 123456 | 07712 345678 |
Author |
Rating:
John Chivers
|
Title |
Test
Details
Pattern Title
|
Expression |
^[1-9]{1}[0-9]{3}\s{0,1}?[a-zA-Z]{2}$ |
Description |
Used for dutch postalcodes; no leading zero. 4 numbers and 2 letters. |
Matches |
1234AB | 1234 AB | 1234 ab |
Non-Matches |
0123AB | 123AA |
Author |
Rating:
Not yet rated.
Michiel Lankamp
|
Title |
Test
Details
Pattern Title
|
Expression |
^[1-9]{1}[0-9]{3}\s?[A-Z]{2}$ |
Description |
Postcode for the Netherlands |
Matches |
1234AB | 1234 AB |
Non-Matches |
123BBB | 023AB |
Author |
Rating:
Not yet rated.
de kleine Gerardus
|
Title |
Test
Details
Pattern Title
|
Expression |
^(\d{3}-\d{3}-\d{4})*$ |
Description |
This expression is a very simplex expression that allows null values or 3 digits, dash, 3 digits, dash, 4 digits. It validates a basic US phone number. Written by Jason N. Gaylord. |
Matches |
555-555-1212 | 123-456-7890 |
Non-Matches |
555.555.1212 | (555) 555-1212 | 5555551212 |
Author |
Rating:
Not yet rated.
Jason N. Gaylord
|
Title |
Test
Details
Pattern Title
|
Expression |
^\d{5}((\-|\s)?\d{4})?$ |
Description |
Single field zip code validator useful for web forms, where user may enter 5 digit or 9 digit zip code, and may use hyphen, space, or no space between the first 5 digits and last 4 digits. |
Matches |
92078 | 92078-4705 | 92078 4705 |
Non-Matches |
920781 | 920a87 | 920 |
Author |
Rating:
Not yet rated.
MARK J KRISBURG
|
Title |
Test
Details
Pattern Title
|
Expression |
(^(?!0{5})(\d{5})(?!-?0{4})(-?\d{4})?$) |
Description |
Javascript matches US zipcodes not allowing all zeros in first 5 or +4 |
Matches |
12345 | 12345-6789 | 123456789 |
Non-Matches |
12345-0000 | 00000-0000 | 00000 |
Author |
Rating:
Not yet rated.
Justin Elsberry
|
Title |
Test
Details
Pattern Title
|
Expression |
^((\d[-. ]?)?((\(\d{3}\))|\d{3}))?[-. ]?\d{3}[-. ]?\d{4}$ |
Description |
This is a pretty flexable phone number validator for US numbers. Allows optional country code and area code. Allows separation of numbers with " ", "-", "." or nothing to seperate. Area codes can be in parenthesis or not. Validates that you'll get 7, 10, or 11 digits in the way the most number of people option when writing them. |
Matches |
1(555)444-3333 | 202.555.3333 | 555-4444 |
Non-Matches |
555-222-33334 | 1(303)5a4-5555 | 1 202) 111-3333 |
Author |
Rating:
Not yet rated.
Josh Aversa
|
Title |
Test
Details
Pattern Title
|
Expression |
[0-9]{4}[A-Z]{2} |
Description |
Match for dutch zipcodes.
Dutch zipcodes are always in the format of 4 digits and 2 letters. |
Matches |
1000AB | 3035KA | 9999ZZ |
Non-Matches |
AA1000 | Z1000 | 1000-CC |
Author |
Rating:
Not yet rated.
marrik
|
Title |
Test
Details
Pattern Title
|
Expression |
^([0-9]{2})?((\([0-9]{2})\)|[0-9]{2})?([0-9]{3}|[0-9]{4})(\-)?[0-9]{4}$ |
Description |
A simple expression to brazilian phone number code modified expression of Rafael, beyond international code, simple DDI without "+" 99 plus simple DDD (99) plus simple and whitout parentheses em trace, local phone number 3 or 4 digits plus "-" plus 4 digits. |
Matches |
552123236699 | 212323-6699 | 2323-6699 |
Non-Matches |
[3434-3432] | [4(23)232-3232] | [55(2)232-232] |
Author |
Rating:
Not yet rated.
wallace dos santos damiao
|
Title |
Test
Details
Pattern Title
|
Expression |
^\([0-9]{3}\)\s?[0-9]{3}(-|\s)?[0-9]{4}$|^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$ |
Description |
US telephone check |
Matches |
1231231234 | (123)123-1234 | 123-123-1234 |
Non-Matches |
12312312345 | (123)-123-1234 | 123 |
Author |
Rating:
Not yet rated.
PJ Bijoy
|
Title |
Test
Details
Pattern Title
|
Expression |
^(\d{2}-\d{2})*$ |
Description |
This expression is a simplex expression that checks to see if a value is a valid phone system terminal number. It allows a null value or 2 digits, dash, 2 digits. Written by Jason N. Gaylord. |
Matches |
00-00 | 54-68 |
Non-Matches |
1235 | 0 | 5-789 |
Author |
Rating:
Not yet rated.
Jason N. Gaylord
|
Title |
Test
Details
Pattern Title
|
Expression |
(^(p[\s|\.|,]*|
^post[\s|\.]*)(o[\s|\.|,]*|
office[\s|\.]*))|
(^box[.|\s]*\d+) |
Description |
This expression filters all variations of Post Office Box or PO Box. |
Matches |
PO Box | p.o. box | box 123 |
Non-Matches |
123 Some Street |
Author |
Rating:
Not yet rated.
Joseph Lamb
|
Title |
Test
Details
Pattern Title
|
Expression |
^\s*((?:(?:\d+(?:\x20+\w+\.?)+(?:(?:\x20+STREET|ST|DRIVE|DR|AVENUE|AVE|ROAD|RD|LOOP|COURT|CT|CIRCLE|LANE|LN|BOULEVARD|BLVD)\.?)?)|(?:(?:P\.\x20?O\.|P\x20?O)\x20*Box\x20+\d+)|(?:General\x20+Delivery)|(?:C[\\\/]O\x20+(?:\w+\x20*)+))\,?\x20*(?:(?:(?:APT|BLDG|DEPT|FL|HNGR|LOT|PIER|RM|S(?:LIP|PC|T(?:E|OP))|TRLR|UNIT|\x23)\.?\x20*(?:[a-zA-Z0-9\-]+))|(?:BSMT|FRNT|LBBY|LOWR|OFC|PH|REAR|SIDE|UPPR))?)\,?\s+((?:(?:\d+(?:\x20+\w+\.?)+(?:(?:\x20+STREET|ST|DRIVE|DR|AVENUE|AVE|ROAD|RD|LOOP|COURT|CT|CIRCLE|LANE|LN|BOULEVARD|BLVD)\.?)?)|(?:(?:P\.\x20?O\.|P\x20?O)\x20*Box\x20+\d+)|(?:General\x20+Delivery)|(?:C[\\\/]O\x20+(?:\w+\x20*)+))\,?\x20*(?:(?:(?:APT|BLDG|DEPT|FL|HNGR|LOT|PIER|RM|S(?:LIP|PC|T(?:E|OP))|TRLR|UNIT|\x23)\.?\x20*(?:[a-zA-Z0-9\-]+))|(?:BSMT|FRNT|LBBY|LOWR|OFC|PH|REAR|SIDE|UPPR))?)?\,?\s+((?:[A-Za-z]+\x20*)+)\,\s+(A[LKSZRAP]|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])\s+(\d+(?:-\d+)?)\s*$ |
Description |
Based on a regular expression from Michael Ash, this captures US street addresses and mailing addresses, single or multi-line (multi-line is more reliable), and breaks them into discrete parts for address line 1 and 2, city, state, and postal code. This expression is not perfect - with the interpreter I am using, some addresses refuse to match correctly. It should however work for most addresses, particularly when lines are delimited with carriage returns, tabs, or some other whitespace line delimiter that is not a space (\x20). Note: For improved compatibility, this expression does not use named groups.
**Output**
\1 = Address 1,
\2 = Address 2,
\3 = City,
\4 = State,
\5 = Postal Code |
Matches |
P.O. Box 42 Huslia, AK 99746 | C/O John Paul, POBox 456, Motown, CA 96090 |
Non-Matches |
4321 East 40th Apt #3 Anchorage AK 99504 | Stockton, CA 95215 |
Author |
Rating:
Not yet rated.
Ross Hammer
|
Title |
Test
Details
Pattern Title
|
Expression |
[0-9]{4}\s*[a-zA-Z]{2} |
Description |
Dutch zip code expression
4 numbers - space yes/no - 2 letters
|
Matches |
1054 WD | 1054WD | 1054 wd |
Non-Matches |
10543 |
Author |
Rating:
Not yet rated.
Roland Mensenkamp
|
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 |
(077|078|079)\s?\d{2}\s?\d{6} |
Description |
Validates UK mobile phone numbers. Valid formats are `077', `078' or `079' followed by another 8 digits, with an optional space after the dialling code and/or between the 4th and 5th characters of the remainder of the number. These formats are taken from the official guidelines from Ofcom, the organisation responsible for UK telecoms issues. Brackets are not valid and STD code must be entered. |
Matches |
07713 345678 | 078 12345678 | 079 12345678 |
Non-Matches |
02344 123456 | 0121 292929 | 012345 6789 |
Author |
Rating:
Not yet rated.
John Chivers
|
Title |
Test
Details
Pattern Title
|
Expression |
^\({0,1}0(2|3|7|8)\){0,1}(\ |-){0,1}[0-9]{4}(\ |-){0,1}[0-9]{4}$ |
Description |
Expression to parse Australian landline telephone numbers. Will only accept valid STD codes. Allows for brackets around the STD code and either spaces or dashes between number groups. |
Matches |
(02) 9323 1234 | 0293231234 | 02-9323-1234 |
Non-Matches |
01 9323 1234 | 02 932 123 | 02/9323/1234 |
Author |
Rating:
Not yet rated.
Ben Vaughan
|
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