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
^([2][0]\d{2}\/([0]\d|[1][0-2])\/([0-2]\d|[3][0-1]))$|^([2][0]\d{2}\/([0]\d|[1][0-2])\/([0-2]\d|[3][0-1])\s([0-1]\d|[2][0-3])\:[0-5]\d\:[0-5]\d)$
Description
this is a regular expression that for chinese programer! yyyy/mm/dd hh:mm:ss
Matches
2002/02/03 | 2002/02/03 12:12:18
Non-Matches
2002/02/36 | 02/03/2002
Author Rating: Not yet rated. martix wang
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]?[1-9]|[1][0-2])[\/|\-|\.]([0-2]\d|[3][0-1]|[1-9])[\/|\-|\.]([2][0])?\d{2}\s+((([0][0-9]|[1][0-2]|[0-9])[\:|\-|\.]([0-5]\d)\s*([aApP][mM])?)|(([0-1][0-9]|[2][0-3]|[0-9])[\:|\-|\.]([0-5]\d))))$
Description
MM-DD-20YY HH:MM AP MM-DD-20YY H:MM AP MM-DD-20YY HH:MM MM-DD-20YY H:MM MM-DD-YY HH:MM AP MM-DD-YY H:MM AP MM-DD-YY HH:MM MM-DD-YY H:MM M-D-YY HH:MM AP M-D-YY H:MM AP M-D-YY HH:MM M-D-YY H:MM where - can be / or - or . where : can be : or - or . Definition: ^( ;Start of Line ([0]?[1-9]|[1][0-2]) ;00-09 or 10-12 or 1-9 [\/|\-|\.] ;/ or - or . ([0-2]\d|[3][0-1]|[1-9]) ;00-29 or 30-31 or 1-9 [\/|\-|\.] ;/ or - or . ([2][0])?\d{2} ;2000-2099 or 00-99 \s+ ;one or more spaces ( ;must be either 12H notation w/AM|PM ( ([0][0-9]|[1][0-2]|[0-9]) [\:|\-|\.] ;: or - or . ([0-5]\d) ;01 thru 59 \s* ;zero or more spaces ([aApP][mM])? ;nothing or AM or PM (case insensitive) ) | ;or 24H notation w/out AM|PM ( ([0-1][0-9]|[2][0-3]|[0-9]) ;00-19 or 20-23 [\:|\-|\.] ;: or - or . ([0-5]\d) ;00-59 ) ) )$ ;End of Line
Matches
01/01/2002 04:42 | 5-12-02 04:42 AM | 01.01/02 04-42aM
Non-Matches
01-12-1999 4:50PM | 01-12-2002 15:10PM | 01-12-002 8:20PM
Author Rating: Not yet rated. Bob Duffett
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
^([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
^((0?[13578]|10|12)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[01]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1}))|(0?[2469]|11)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[0]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1})))$
Description
improved date validation M/D/YY or M/D/YYYY or MM/DD/YYYY or MM/DD/YY: 1/1/1920 through 12/31/2019; Feb 29 and 30 always allowed, deal with it
Matches
1/2/03 | 02/30/1999 | 3/04/00
Non-Matches
3/4/2020 | 3/4/1919 | 4/31/2000
Author Rating: Not yet rated. Brad Williams
Title Test Details Pattern Title
Expression
^(20|21|22|23|[01]\d|\d)(([:.][0-5]\d){1,2})$
Description
24 hour clock as prefered by MS-SQL, allows for shorter more human methods of writing time (no preceding zero or seconds required). MS-SQL prefers semi-colon although this accepts full stops for users ease of use.
Matches
09:00:00 | 09.00 | 9:00
Non-Matches
9:00AM
Author Rating: Not yet rated. Adam Smith
Title Test Details Pattern Title
Expression
(?n:^(?=\d)((?<month>(0?[13578])|1[02]|(0?[469]|11)(?!.31)|0 ?2(?(.29)(?=.29.((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][ 26])|(16|[2468][048]|[3579][26])00))|(?!.3[01])))(?<sep>[-./ ])(?<day>0?[1-9]|[12]\d|3[01])\k<sep>(?<year>(1[6-9]|[2-9]\d )\d{2})(?(?=\x20\d)\x20|$))?(?<time>((0?[1-9]|1[012])(:[0-5] \d){0,2}(?i:\x20[AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$)
Description
Matches
02/27/2005
Non-Matches
02/29/2005
Author Rating: Not yet rated. Abhinav Gupta
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
([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
^(([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
^(?:(?: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 7 of 7 pages; Items 121 to 134

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