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: 330 regular expressions found.

Change page:   |    Displaying page 1 of 17 pages; Items 1 to 20
Title Test Details Pattern Title
Expression
^#?([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?$
Description
Tests for valid HTML hexadecimal color codes. The # symbol is optional. And it will except either the 3 digit form for the 216 Web safe colors, or the full 6 digit form. I am use it on my site to allow users to customize the site's colors.
Matches
#00ccff | #039 | ffffcc
Non-Matches
blue | 0x000000 | #ff000
Author Rating: The rating for this expression. Chris Craft
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*$
Description
Accepts an unsigned integer number. Also matches empty strings.
Matches
123 | 000 | 43
Non-Matches
asbc | -34 | 3.1415
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
((\(\d{3}\)?)|(\d{3}))([\s-./]?)(\d{3})([\s-./]?)(\d{4})
Description
US Phone number that accept a dot, a space, a dash, a forward slash, between the numbers. Will Accept a 1 or 0 in front. Area Code not necessary
Matches
1.2123644567 | 0-234.567/8912 | 1-(212)-123 4567
Non-Matches
0-212364345 | 1212-364,4321 | 0212\345/6789
Author Rating: Not yet rated. Mart Maasikas
Title Test Details Pattern Title
Expression
(^|\s|\()((([1-9]){1}|([0][1-9]){1}|([1][012]){1}){1}[\/-]((2[0-9]){1}|(3[01]){1}|([01][1-9]){1}|([1-9]){1}){1}[\/-](((19|20)([0-9][0-9]){1}|([0-9][0-9]){1})){1}(([\s|\)|:])|(^|\s|\()((([0-9]){1}|([0][1-9]){1}|([1][012]){1}){1}[\/-](([11-31]){1}|([01][1-9]){1}|([1-9]){1}){1}[\/-](((19|20)([0-9][0-9]){1}|([0-9][0-9]){1})){1}(([\s|\)|:|$|\>])){1}){1}){1}){1}
Description
Will match the following date formats: Preceded by a Space, Left-parentheses, or at the beginning of a line. Followed by a Space, Right-parentheses, or Colon(:), word boundary or End of line. Can have / or - as separator. Accepts 2 digit year 00-99 or 4 digit years 1900-2099 (can modify to accept any range)
Matches
01/01/2001 | 01-01-2001: | (1-1-01)
Non-Matches
13/1/2001 | 1-32-2001 | 1-1-1801
Author Rating: The rating for this expression. David Good
Title Test Details Pattern Title
Expression
^((?:4\d{3})|(?:5[1-5]\d{2})|(?:6011)|(?:3[68]\d{2})|(?:30[012345]\d))[ -]?(\d{4})[ -]?(\d{4})[ -]?(\d{4}|3[4,7]\d{13})$
Description
This just a minor mod to Steven Smith's credit card re to accept spaces as separators, as well as return the four parts of the card. [Updated Oct-18-2002 to work with Diners Club/Carte Blanche (prefix must be 36, 38, or 300-305)]
Matches
6011567812345678 | 6011 5678 1234 5678 | 6011-5678-1234-5678
Non-Matches
1234567890123456
Author Rating: The rating for this expression. Glenn Carr
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[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: The rating for this expression. Steven Smith
Title Test Details Pattern Title
Expression
^((((0[13578])|([13578])|(1[02]))[\/](([1-9])|([0-2][0-9])|(3[01])))|(((0[469])|([469])|(11))[\/](([1-9])|([0-2][0-9])|(30)))|((2|02)[\/](([1-9])|([0-2][0-9]))))[\/]\d{4}$|^\d{4}$
Description
The following validates dates with and without leading zeros in the following formats: MM/DD/YYYY and it also takes YYYY (this can easily be removed). All months are validated for the correct number of days for that particular month except for February which can be set to 29 days. date day month year
Matches
01/01/2001 | 1/01/2001 | 2002
Non-Matches
2/30/2002 | 13/23/2002 | 12345
Author Rating: Not yet rated. Matt Adams
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
^\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
^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$
Description
This matches floating point expression in a more rigorous way - accepts both exponent as well as non exponent notations.
Matches
123 | -123.35 | -123.35e-2
Non-Matches
abc | 123.32e | 123.32.3
Author Rating: The rating for this expression. Srinivas Gummadi
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
Title Test Details Pattern Title
Expression
^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$
Description
This will grep for a valid MAC address , with colons seperating octets. It will ignore strings too short or long, or with invalid characters. It will accept mixed case hexadecimal. Use extended grep.
Matches
01:23:45:67:89:ab | 01:23:45:67:89:AB | fE:dC:bA:98:76:54
Non-Matches
01:23:45:67:89:ab:cd | 01:23:45:67:89:Az | 01:23:45:56:
Author Rating: Not yet rated. Ted Rudyk
Title Test Details Pattern Title
Expression
^((((31\/(0?[13578]|1[02]))|((29|30)\/(0?[1,3-9]|1[0-2])))\/(1[6-9]|[2-9]\d)?\d{2})|(29\/0?2\/(((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]))\/((1[6-9]|[2-9]\d)?\d{2})) (20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d$
Description
this expression validates a date-time field in European d/m/y h:m:s format. It is a european variation of Michael Ash's date-validation expression in this library. 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
Matches
29/02/2004 20:15:27 | 29/2/04 8:9:5 | 31/3/2004 9:20:17
Non-Matches
29/02/2003 20:15:15 | 2/29/04 20:15:15 | 31/3/4 9:20:17
Author Rating: Not yet rated. martin devos
Title Test Details Pattern Title
Expression
^.+@[^\.].*\.[a-z]{2,}$
Description
Most email validation regexps are outdated and ignore the fact that domain names can contain any foreign character these days, as well as the fact that anything before @ is acceptable. The only roman alphabet restriction is in the TLD, which for a long time has been more than 2 or 3 chars (.museum, .aero, .info). The only dot restriction is that . cannot be placed directly after @. This pattern captures any valid, reallife email adress.
Matches
Non-Matches
Author Rating: The rating for this expression. Thor Larholm
Title Test Details Pattern Title
Expression
(^\d{5}-\d{3}|^\d{2}.\d{3}-\d{3}|\d{8})
Description
Validar o do CEP Brasileiro com 8 posicoes podendo usar mascara . e - ou somente numeros
Matches
12.345-678 | 12345-678 | 12345678
Non-Matches
12.345678 | 12345-1 | 123
Author Rating: Not yet rated. Fernando Cerqueira
Title Test Details Pattern Title
Expression
^\$?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$
Description
Many currency expresssions allow leading zeros, thus $01.40 passes thru them. This expression kills them, except for 0 in the one's column. Works with or without commas and/or dollar sign. Decimals not mandatory, unless no zero in ones column and decimal point is placed. Allows $0.00 and .0 Keywords: money dollar currency
Matches
$1,234.50 | $0.70 | .7
Non-Matches
$0,123.50 | $00.5
Author Rating: The rating for this expression. Tom Persing
Title Test Details Pattern Title
Expression
^(/w|/W|[^<>+?$%{}&])+$
Description
simple expression for excluding a given list of characters. simply change the contents of [^] to suite your needs. for example ^(/w|/W|[^&lt;&gt;])+$ would allow everything except the characters &lt; and &gt;.
Matches
John Doe Sr. | 100 Elm St., Suite 25 | Valerie's Gift Shop
Non-Matches
<h1>Hey</h1>
Author Rating: Not yet rated. Glenn Caccia
Title Test Details Pattern Title
Expression
^(([0]?[1-9]|1[0-2])(:)([0-5][0-9]))$
Description
This time validation expression accepts an hour between 1 and 9 (with optional leading zero) and minutes between 01 and 59. This is primarily for use with an AM/PM drop down list or radio button.
Matches
09:00 | 9:00 | 11:35
Non-Matches
13:00 | 9.00 | 6:60
Author Rating: Not yet rated. Ken Madden
Change page:   |    Displaying page 1 of 17 pages; Items 1 to 20

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