Displaying page
of
pages;
Items to
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:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
(\w+)\s+\1 |
Description |
This expression uses a BackReference to find occurrences of the same word twice in a row (separated by a space).
Matches things like 'mandate dated', which may not be desirable. See Sean Carley's update for a better expression for true repeated word matching. |
Matches |
hubba hubba | mandate dated | an annual |
Non-Matches |
may day | gogo | 1212 |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^\w+[\w-\.]*\@\w+((-\w+)|(\w*))\.[a-z]{2,3}$ |
Description |
Email validation. With this short expression you can validate for proper email format. It's short and accurate. |
Matches |
|
Non-Matches |
|
Author |
Rating:
Eric Lebetsamer
|
Title |
Test
Details
Pattern Title
|
Expression |
^\$[0-9]+(\.[0-9][0-9])?$ |
Description |
Validates a dollar amount including a dollar sign and 2 decmals. The decimal and cents are optional. |
Matches |
$1.50 | $49 | $0.50 |
Non-Matches |
1.5 | $1.333 | this $5.12 fails |
Author |
Rating:
Not yet rated.
Bob Levittan
|
Title |
Test
Details
Pattern Title
|
Expression |
\b(([01]?\d?\d|2[0-4]\d|25[0-5])\.){3}([01]?\d?\d|2[0-4]\d|25[0-5])\b |
Description |
Most Concise RegExp for matching Decimal IPs. If nothing else, it'll make your code easier to read. (And I know that \d?\d is \d{1,2} but that's 2 extra characters.)
--Update: darkone noticed 8 characters could be shaved down. I've edited it to reflect this. Thanks, darkone! |
Matches |
217.6.9.89 | 0.0.0.0 | 255.255.255.255 |
Non-Matches |
256.0.0.0 | 0978.3.3.3 | 65.4t.54.3 |
Author |
Rating:
Sean Schricker
|
Title |
Test
Details
Pattern Title
|
Expression |
^[0-9]+$ |
Description |
Validate a string to see if it contains a number / integer |
Matches |
1234567890 | 1234567890 | 1234567890 |
Non-Matches |
http://none | http://none | http://none |
Author |
Rating:
Mr M
|
Title |
Test
Details
Pattern Title
|
Expression |
^[0,1]?\d{1}\/(([0-2]?\d{1})|([3][0,1]{1}))\/(([1]{1}[9]{1}[9]{1}\d{1})|([2-9]{1}\d{3}))$ |
Description |
This expression checks the validity of a date (US, but it is easily editable for other format's). Year's 1990-9999, Month's 1 or 01 to 12, Day's 1 or 01 to 31. Still needs to have individual months added (i.e., Feb's 28 days), and some how to check for leap year...the months issue should not be to hard, but the leap year seems like a real chore. Please let me know if you have any suggestions for leap year.
|
Matches |
01/01/1990 | 12/12/9999 | 3/28/2001 |
Non-Matches |
3-8-01 | 13/32/1001 | 03/32/1989 |
Author |
Rating:
Scott Watermasysk
|
Title |
Test
Details
Pattern Title
|
Expression |
(^(4|5)\d{3}-?\d{4}-?\d{4}-?\d{4}|(4|5)\d{15})|(^(6011)-?\d{4}-?\d{4}-?\d{4}|(6011)-?\d{12})|(^((3\d{3}))-\d{6}-\d{5}|^((3\d{14}))) |
Description |
This provides an expression to calidate the four major credit cards. It can be easily broken up to use for a specific type of card. It does not validate the number being a potential real number, only in the correct format. |
Matches |
4111-1234-1234-1234 | 6011123412341234 | 3711-123456-12345 |
Non-Matches |
1234567890123456 | 4111-123-1234-1234 | 412-1234-1234-1234 |
Author |
Rating:
Chris Love
|
Title |
Test
Details
Pattern Title
|
Expression |
^(([1-9])|(0[1-9])|(1[0-2]))\/((0[1-9])|([1-31]))\/((\d{2})|(\d{4}))$ |
Description |
Matches U.S. dates with leading zeros and without and with 2 or four digit years |
Matches |
01/01/2001 | 1/1/2001 | 01/1/01 |
Non-Matches |
13/01/2001 | 1/2/100 | 09/32/2001 |
Author |
Rating:
Chris Becker
|
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:
Andrew Lader
|
Title |
Test
Details
Pattern Title
|
Expression |
^[0-9]{4}\s{0,1}[a-zA-Z]{2}$ |
Description |
Regular expression to evaluate dutch zipcodes. This is an updated version of Roland Mensenkamp. |
Matches |
2034AK | 2034 AK | 2034 ak |
Non-Matches |
2034 AK | 321321 AKSSAA |
Author |
Rating:
Not yet rated.
Jon van Leuven
|
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:
David Good
|
Title |
Test
Details
Pattern Title
|
Expression |
^(([1-9])|(0[1-9])|(1[0-2]))\/(([0-9])|([0-2][0-9])|(3[0-1]))\/(([0-9][0-9])|([1-2][0,9][0-9][0-9]))$ |
Description |
Dates
day: d or dd, <= 31,
month: m or mm, <= 12,
year: yy or yyyy >= 1900, <= 2099
|
Matches |
01/01/2001 | 1/1/1999 | 10/20/2080 |
Non-Matches |
13/01/2001 | 1/1/1800 | 10/32/2080 |
Author |
Rating:
Scott Thompson
|
Title |
Test
Details
Pattern Title
|
Expression |
^(s-|S-){0,1}[0-9]{3}\s?[0-9]{2}$ |
Description |
Validates swedish zipcodes (postnr) with or without space between groups. With leading s- or not. Can be disconnected by removing ''(s-|S-){0,1}''. |
Matches |
12345 | 932 68 | S-621 46 |
Non-Matches |
5367 | 425611 | 31 545 |
Author |
Rating:
Not yet rated.
Tommy Ullberg
|
Title |
Test
Details
Pattern Title
|
Expression |
((0?[13578]|10|12)(-|\/)((0[0-9])|([12])([0-9]?)|(3[01]?))(-|\/)((\d{4})|(\d{2}))|(0?[2469]|11)(-|\/)((0[0-9])|([12])([0-9]?)|(3[0]?))(-|\/)((\d{4}|\d{2}))) |
Description |
Regex used in .NET to validate a date. Matches the following formats mm/dd/yy, mm/dd/yyyy, mm-dd-yy, mm-dd-yyyy
This covers days with 30 or 31 days but does not handle February, it is allowed 30 days. |
Matches |
1/31/2002 | 04-30-02 | 12-01/2002 |
Non-Matches |
2/31/2002 | 13/0/02 | Jan 1, 2001 |
Author |
Rating:
Sean McAnally
|
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:
Santosh Potadar
|
Title |
Test
Details
Pattern Title
|
Expression |
^[A-Za-z]{2}[0-9]{6}[A-Za-z]{1}$ |
Description |
UK National Insurance Number validation. Especially useful to validate through clientside/server side script on a website. |
Matches |
SP939393H | PX123456D | SW355667G |
Non-Matches |
12SP9393H | S3P93930D | 11223344SP00ddSS |
Author |
Rating:
Not yet rated.
Santosh Potadar
|
Title |
Test
Details
Pattern Title
|
Expression |
20\d{2}(-|\/)((0[1-9])|(1[0-2]))(-|\/)((0[1-9])|([1-2][0-9])|(3[0-1]))(T|\s)(([0-1][0-9])|(2[0-3])):([0-5][0-9]):([0-5][0-9]) |
Description |
Sql date format tester. |
Matches |
2099-12-31T23:59:59 | 2002/02/09 16:30:00 | 2000-01-01T00:00:00 |
Non-Matches |
2000-13-31T00:00:00 | 2002/02/33 24:00:00 | 2000-01-01 60:00:00 |
Author |
Rating:
Peter Pfeifer
|
Title |
Test
Details
Pattern Title
|
Expression |
^\d{4}[\-\/\s]?((((0[13578])|(1[02]))[\-\/\s]?(([0-2][0-9])|(3[01])))|(((0[469])|(11))[\-\/\s]?(([0-2][0-9])|(30)))|(02[\-\/\s]?[0-2][0-9]))$ |
Description |
- validates a yyyy-mm-dd, yyyy mm dd, or yyyy/mm/dd date
- makes sure day is within valid range for the month
- does NOT validate Feb. 29 on a leap year, only that Feb. CAN have 29 days |
Matches |
0001-12-31 | 9999 09 30 | 2002/03/03 |
Non-Matches |
0001\02\30 | 9999.15.01 | 2002/3/3 |
Author |
Rating:
Rex Po
|
Displaying page
of
pages;
Items to