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

Please support RegExLib Sponsors

Sponsors

Advanced Search

Keywords

Category

Minimum Rating

Results per Page

Search Results: 235 regular expressions found.

Change page:   |    Displaying page 1 of 12 pages; Items 1 to 20
Title Test Details Five Integer US ZIP Code
Expression
^\d{5}$
Description
Matches 5 numeric digits, such as a zip code.
Matches
33333 | 55555 | 23445
Non-Matches
abcd | 1324 | as;lkjdf
Author Rating: The rating for this expression. Steven Smith
Title Test Details US ZIP (5 or 5+4)
Expression
^\d{5}$|^\d{5}-\d{4}$
Description
This regular expression will match either a 5 digit ZIP code or a ZIP+4 code formatted as 5 digits, a hyphen, and another 4 digits. Other than that, this is just a really really long description of a regular expression that I'm using to test how my front page will look in the case where very long expression descriptions are used.
Matches
55555-5555 | 34564-3342 | 90210
Non-Matches
434454444 | 645-32-2345 | abc
Author Rating: Not yet rated. Steven Smith
Title Test Details Date With Slashes
Expression
^\d{1,2}\/\d{1,2}\/\d{4}$
Description
This regular expressions matches dates of the form XX/XX/YYYY where XX can be 1 or 2 digits long and YYYY is always 4 digits long.
Matches
4/1/2001 | 12/12/2001 | 55/5/3434
Non-Matches
1/1/01 | 12 Jan 01 | 1-1-2001
Author Rating: The rating for this expression. Steven Smith
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: The rating for this expression. Steven Smith
Title Test Details Pattern Title
Expression
\d{4}-?\d{4}-?\d{4}-?\d{4}
Description
Major credit card validator. Only checks that the format is 16 digits (optionally separated by hyphens), not the value of any of the digits.
Matches
1234-1234-1234-1234 | 1234123412341234
Non-Matches
1234123412345
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
^(?=.*\d).{4,8}$
Description
Password expression. Password must be between 4 and 8 digits long and include at least one numeric digit.
Matches
1234 | asdf1234 | asp123
Non-Matches
asdf | asdf12345 | password
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
\(([0-9]{2}|0{1}((x|[0-9]){2}[0-9]{2}))\)\s*[0-9]{3,4}[- ]*[0-9]{4}
Description
Match diferent styles for brazilian Phone number code. Only DDD (12), complete DDD (012), complete DDD + Telephony Company (0xx12) plus 3 or 4 digits (city code) plus 4 digits (phone number).
Matches
(12) 123 1234 | (01512) 123 1234 | (0xx12) 1234 1234
Non-Matches
12 123 1234 | (012) 123/1234 | (012) 123 12345
Author Rating: Not yet rated. Samuel Mota
Title Test Details Pattern Title
Expression
^((4\d{3})|(5[1-5]\d{2})|(6011))-?\d{4}-?\d{4}-?\d{4}|3[4,7]\d{13}$
Description
Matches major credit cards including: Visa (length 16, prefix 4), Mastercard (length 16, prefix 51-55), Discover (length 16, prefix 6011), American Express (length 15, prefix 34 or 37). All 16 digit formats accept optional hyphens (-) between each group of four digits.
Matches
6011-1111-1111-1111 | 5423-1111-1111-1111 | 341111111111111
Non-Matches
4111-111-111-111 | 3411-1111-1111-111 | Visa
Author Rating: The rating for this expression. Steven Smith
Title Test Details Pattern Title
Expression
((\d{2})|(\d))\/((\d{2})|(\d))\/((\d{4})|(\d{2}))
Description
This matches simple dates against 1 or 2 digits for the month, 1 or 2 digit for the day, and either 2 or 4 digits for the year
Matches
4/5/91 | 04/5/1991 | 4/05/89
Non-Matches
4/5/1
Author Rating: The rating for this expression. Andrew Lader
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
^( [1-9]|[1-9]|0[1-9]|10|11|12)[0-5]\d$
Description
Matches a 12-hour time value expressed as either 4 numeric digits, 3 numeric digits, or a space and 3 numeric digits. 3 digit times (930) can be expressed with leading 0's (0930) or not. AM/PM designation is not included in this expression.
Matches
1145 | 933 | 801
Non-Matches
0000 | 1330 | 8:30
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
^\d{1,2}\/\d{2,4}$
Description
Accepts 1-2 digits followed by a slash followed by 2-4 digits. Useful for numeric month/year entry.
Matches
9/02 | 09/2002 | 09/02
Non-Matches
Fall 2002 | Sept 2002
Author Rating: Not yet rated. Mike Hensley
Title Test Details Pattern Title
Expression
^(|(0[1-9])|(1[0-2]))\/((0[1-9])|(1\d)|(2\d)|(3[0-1]))\/((\d{4}))$
Description
This expression matches dates formatted as MM/DD/YYYY where months and days must be 2 digits each, zero padded. It is not perfect - it allows DD to be from 01 to 31 regardless of the month.
Matches
01/01/2001 | 02/30/2001 | 12/31/2002
Non-Matches
1/1/02 | 1/1/2002 | 1/25/2002
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
^((((0[13578])|(1[02]))[\/]?(([0-2][0-9])|(3[01])))|(((0[469])|(11))[\/]?(([0-2][0-9])|(30)))|(02[\/]?[0-2][0-9]))[\/]?\d{4}$
Description
Date expressions that matches MM/DD/YYYY where MM and DD must be two digits and zero padded. Validates correctly for all months except February, which it assumes to always have 29 days. The "/" separator is optional.
Matches
01/01/2001 | 02/29/2002 | 12/31/2002
Non-Matches
1/1/02 | 02/30/2002 | 1/25/2002
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
^\d{3}\s?\d{3}$
Description
This can be used to match indian style pincodes / postal codes used by the indian postal departments which are 6 digits long and may have space after the 3rd digit
Matches
400 099 | 400099 | 400050
Non-Matches
2345678 | 12345 | asdf
Author Rating: Not yet rated. anup kallingal
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
^\d{5}(-\d{3})?$
Description
Matches standard 5 digit Brazilian Postal Codes (CEP), or the CEP + 3 digits (distribution identifiers - suffix). For more info refer to: http://www.correios.com.br/servicos/cep/Estrutura_CEP.cfm (in portuguese).
Matches
13165-000 | 38175-000 | 81470-276
Non-Matches
13165-00 | 38175-abc | 81470-2763
Author Rating: Not yet rated. Carlos Nascimento
Title Test Details Pattern Title
Expression
^([0-9]{2})?(\([0-9]{2})\)([0-9]{3}|[0-9]{4})-[0-9]{4}$
Description
A simple expression to brazilian phone number code, with international code. Simple DDI without "+" 99 plus simple DDD (99) plus simple local phone number 3 or 4 digits plus "-" plus 4 digits.
Matches
55(21)123-4567 | (11)1234-5678 | 55(71)4562-2234
Non-Matches
3434-3432 | 4(23)232-3232 | 55(2)232-232
Author Rating: Not yet rated. Rafael Miranda
Title Test Details Pattern Title
Expression
^\d{2}(\x2e)(\d{3})(-\d{3})?$
Description
Other expression to standard 5 digit Brazilian Postal Codes (CEP), or the CEP + 3 digits (distribution identifiers - suffix). The diference of the original one, is that the "." is mandatory.
Matches
12.345-678 | 23.345-123 | 99.999
Non-Matches
41222-222 | 3.444-233 | 43.324444
Author Rating: Not yet rated. Rafael Miranda
Title Test Details Pattern Title
Expression
^(?:(?:31(\/|-|\.)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(\/|-|\.)(?:0?[1,3-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(\/|-|\.)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/|-|\.)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$
Description
This expression validates dates in the ITALIAN d/m/y format from 1/1/1600 - 31/12/9999. The days are validated for the given month and year. Leap years are validated for all 4 digits years from 1600-9999, and all 2 digits years except 00 since it could be any century (1900, 2000, 2100). Days and months must be 1 or 2 digits and may have leading zeros. Years must be 2 or 4 digit years. 4 digit years must be between 1600 and 9999. Date separator may be a slash (/), dash (-), or period (.) Thanks to Michael Ash for US Version
Matches
29/02/1972 | 5-9-98 | 10-11-2002
Non-Matches
29/02/2003 | 12/13/2002 | 1-1-1500
Author Rating: Not yet rated. Marco Storti
Change page:   |    Displaying page 1 of 12 pages; Items 1 to 20

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