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

Please support RegExLib Sponsors

Sponsors

Browse Expressions by Category

134 regular expressions found in this category!

Expressions in category: Dates and Times

Change page:   |    Displaying page 7 of 7 pages; Items 121 to 134
Title Test Details Pattern Title
Expression
^((([0]?[1-9]|1[0-2])(:|\.)(00|15|30|45)?( )?(AM|am|aM|Am|PM|pm|pM|Pm))|(([0]?[0-9]|1[0-9]|2[0-3])(:|\.)(00|15|30|45)?))$
Description
This expression will allow a time value with 15 minute increments. It will not accept seconds. You can use either US time or Military time format.
Matches
1:00 PM | 6:45 am | 17:30
Non-Matches
4:32 am | 5:30:00 am | 17:01
Author Rating: Not yet rated. Rick Yokum
Title Test Details Pattern Title
Expression
(^((((0[1-9])|([1-2][0-9])|(3[0-1]))|([1-9]))\x2F(((0[1-9])|(1[0-2]))|([1-9]))\x2F(([0-9]{2})|(((19)|([2]([0]{1})))([0-9]{2}))))$)
Description
dd/mm/yy Check dates between 1/1/1900 - 31/12/2099
Matches
31/12/2099 | 1/1/1900 | 10/12/2003
Non-Matches
05/11/3000 | 11/13/2003 | 32/04/2030
Author Rating: Not yet rated. Carlos R. L. Rodrigues
Title Test Details Pattern Title
Expression
^([1][12]|[0]?[1-9])[\/-]([3][01]|[12]\d|[0]?[1-9])[\/-](\d{4}|\d{2})$
Description
Matches dates with the following format Month - either MM (like 01) or M (like 1) - from 1 to 12 Day - either DD (like 01) or D ( like 1) - from 1 to 31 Year - either YYYY ( like 1998) or YY (like 98) Separater - either - or /
Matches
11-02-02 | 1-25-2002 | 01/25/2002
Non-Matches
13-02-02 | 11.02.02 | 11/32/2002
Author Rating: Not yet rated. Mekonnen Mekonnen
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]|2\d)|3[0-1])\/(19\d\d|200[0-3])$
Description
This expression is an attempt to match the most obvious features of a valid date in American/US format of the form mm/dd/yyyy for any year 1900 through 2003. It can easily be adapted for different date ranges. It matches any date where the day part is any number 01-31, the month part is any number 01-12, and the year part is any number 1900-2003. The only invalid dates that it matches are ones where the day part may be in the range 01-31 but that range might not be valid for the specified month. An example of an invalid date that it would allow to pass through would be 11/31/2002. This date is invalid because 11/31 of any year does not exist, but this expression would allow it pass through since the day part is in the range 01-31. This regular expression has been used successfully in ASP with VBScript using the windows scripting library RegExp object.
Matches
12/31/2003 | 01/01/1900 | 11/31/2002
Non-Matches
1/1/2002 | 01/01/02 | 01/01/2004
Author Rating: Not yet rated. Josh Bailyr
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]?[0-5][0-9]|[0-9]):([0-5][0-9]))$
Description
This regex is to validate the time of a ~60 minute CD where the most time on the CD is 59:59 (minutes:seconds). It is derived from Ken Madden's time regex for a project for Erik Porter (Windows/Web guru). Written by Jason Gaylord.
Matches
30:05 | 5:05 | 02:59
Non-Matches
25:7 | 5m:16 | 60:60
Author Rating: Not yet rated. Jason N. Gaylord
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
Title Test Details Pattern Title
Expression
^([0]\d|[1][0-2])\/([0-2]\d|[3][0-1])\/([2][01]|[1][6-9])\d{2}(\s([0]\d|[1][0-2])(\:[0-5]\d){1,2})*\s*([aApP][mM]{0,2})?$
Description
This is a combination of a few regular expressions found on this site. It allows for a flexible date and time combination, but requires a 12-hour clock (am/pm). Many versions of the am/pm are supported.
Matches
12/31/2002 | 12/31/2002 08:00 | 12/31/2002 08:00 AM
Non-Matches
12/31/02 | 12/31/2002 14:00
Author Rating: Not yet rated. Bill LaPrade
Title Test Details Pattern Title
Expression
^(?=\d)(?:(?:31(?!.(?:0?[2469]|11))|(?:30|29)(?!.0?2)|29(?=.0?2.(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(?:\x20|$))|(?:2[0-8]|1\d|0?[1-9]))([-./])(?:1[012]|0?[1-9])\1(?:1[6-9]|[2-9]\d)?\d\d)?(\x20?((0?[1-9]|1[012])(:[0-5]\d){0,2}(\x20[AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$
Description
Matches
12/12/2003
Non-Matches
31/02/203
Author Rating: Not yet rated. hayri hayri
Title Test Details Pattern Title
Expression
([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})
Description
Checks for Date in the typical MySQL DB Format. Not mutch but simple to for converting to German date format: $date = "2003-12-03"; if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs)) { echo "$regs[3].$regs[2].$regs[1]"; // prints 03.12.2003 }
Matches
2002-11-03 | 2007-17-08 | 9999-99-99
Non-Matches
2002/17/18 | 2002.18.45 | 18.45.2002
Author Rating: Not yet rated. Mike T Spike
Title Test Details Pattern Title
Expression
^ *(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M) *$
Description
validate 12-hour time with am/pm after it, with optional spaces before or after, and optionally between time and am/pm.
Matches
12:00am | 1:00 PM | 12:59 pm
Non-Matches
0:00 | 0:01 am | 13:00 pm
Author Rating: Not yet rated. Jim Tebbel
Title Test Details Pattern Title
Expression
(^([0-9]|[0-1][0-9]|[2][0-3]):([0-5][0-9])(\s{0,1})(AM|PM|am|pm|aM|Am|pM|Pm{2,2})$)|(^([0-9]|[1][0-9]|[2][0-3])(\s{0,1})(AM|PM|am|pm|aM|Am|pM|Pm{2,2})$)
Description
Validate “Time” Data to Work with SQL Server This is a fix (I hope) for a problem with the original expression. It originally allowed any combination of am or pm. For example: ma, aa, mm, mp, etc.
Matches
8am | 8 am | 8:00 am
Non-Matches
8a | 8 a | 8:00 a
Author Rating: Not yet rated. Greg Burns
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
Change page:   |    Displaying page 7 of 7 pages; Items 121 to 134

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