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 4 of 7 pages; Items 61 to 80
Title Test Details Pattern Title
Expression
^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((1[6-9]|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((1[6-9]|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((1[6-9]|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$
Description
dd/MM/yyyy with leap years 100% integrated Valid years : from 1600 to 9999 As usual, many tests have been made. I think this one should be fine.
Matches
29/02/2000 | 30/04/2003 | 01/01/2003
Non-Matches
29/02/2001 | 30-04-2003 | 1/1/2003
Author Rating: The rating for this expression. Dany Lauener
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: The rating for this expression. Peter Pfeifer
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 Days of the week
Expression
^(Sun|Mon|(T(ues|hurs))|Fri)(day|\.)?$|Wed(\.|nesday)?$|Sat(\.|urday)?$|T((ue?)|(hu?r?))\.?$
Description
This RE matches Days of the week or their abbreviations.
Matches
Sunday | Mon | Tu
Non-Matches
day | Wedday | Payday
Author Rating: The rating for this expression. Michael Ash
Title Test Details Pattern Title
Expression
(((0[1-9]|[12][0-9]|3[01])([-./])(0[13578]|10|12)([-./])(\d{4}))|(([0][1-9]|[12][0-9]|30)([-./])(0[469]|11)([-./])(\d{4}))|((0[1-9]|1[0-9]|2[0-8])([-./])(02)([-./])(\d{4}))|((29)(\.|-|\/)(02)([-./])([02468][048]00))|((29)([-./])(02)([-./])([13579][26]00))|((29)([-./])(02)([-./])([0-9][0-9][0][48]))|((29)([-./])(02)([-./])([0-9][0-9][2468][048]))|((29)([-./])(02)([-./])([0-9][0-9][13579][26])))
Description
Jason West ([email protected]) date validator with leap years using a strict dd/mm/yyyy (ITALIAN) format
Matches
29/02/2000 | 31/01/2000 | 30-01-2000
Non-Matches
29/02/2002 | 32/01/2002 | 10/2/2002
Author Rating: The rating for this expression. Alessandro Olivi
Title Test Details Pattern Title
Expression
(?=\d)^(?:(?!(?:10\D(?:0?[5-9]|1[0-4])\D(?:1582))|(?:0?9\D(?:0?[3-9]|1[0-3])\D(?:1752)))((?:0?[13578]|1[02])|(?:0?[469]|11)(?!\/31)(?!-31)(?!\.31)|(?:0?2(?=.?(?:(?:29.(?!000[04]|(?:(?:1[^0-6]|[2468][^048]|[3579][^26])00))(?:(?:(?:\d\d)(?:[02468][048]|[13579][26])(?!\x20BC))|(?:00(?:42|3[0369]|2[147]|1[258]|09)\x20BC))))))|(?:0?2(?=.(?:(?:\d\D)|(?:[01]\d)|(?:2[0-8])))))([-.\/])(0?[1-9]|[12]\d|3[01])\2(?!0000)((?=(?:00(?:4[0-5]|[0-3]?\d)\x20BC)|(?:\d{4}(?!\x20BC)))\d{4}(?:\x20BC)?)(?:$|(?=\x20\d)\x20))?((?:(?:0?[1-9]|1[012])(?::[0-5]\d){0,2}(?:\x20[aApP][mM]))|(?:[01]\d|2[0-3])(?::[0-5]\d){1,2})?$
Description
mm/dd/yyyy hh:MM:ss Datetime for all AD years, including leap years. Javascript safe version of http://regexlib.com/REDetails.aspx?regexp_id=644. Please see that regex for details of what is being checked
Matches
11/24/0004 11:59 PM | 2.29.2008 | 02:50:10
Non-Matches
12/33/1020 | 2/29/2005 | 13:00 AM
Author Rating: The rating for this expression. Michael Ash
Title Test Details Pattern Title
Expression
^((((([0-1]?\d)|(2[0-8]))\/((0?\d)|(1[0-2])))|(29\/((0?[1,3-9])|(1[0-2])))|(30\/((0?[1,3-9])|(1[0-2])))|(31\/((0?[13578])|(1[0-2]))))\/((19\d{2})|([2-9]\d{3}))|(29\/0?2\/(((([2468][048])|([3579][26]))00)|(((19)|([2-9]\d))(([2468]0)|([02468][48])|([13579][26]))))))\s(([01]?\d)|(2[0-3]))(:[0-5]?\d){2}$
Description
My definitive Date and Time pattern (dd/mm/yyyy hh:mm:ss). It recognizes all correct dates (>1900) and time (even february). What can I say, I'm proud of it
Matches
29/2/2004 15:16:57 | 29/01/1900 18:17:15
Non-Matches
29/2/1900 14:13:11
Author Rating: The rating for this expression. Bernat Sales
Title Test Details yy/mm/dd Date
Expression
^(?:(?:(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(\/|-|\.)(?:0?2\1(?:29)))|(?:(?:(?:1[6-9]|[2-9]\d)?\d{2})(\/|-|\.)(?:(?:(?:0?[13578]|1[02])\2(?:31))|(?:(?:0?[1,3-9]|1[0-2])\2(29|30))|(?:(?:0?[1-9])|(?:1[0-2]))\2(?:0?[1-9]|1\d|2[0-8]))))$
Description
This expression validates dates in the y/m/d format from 1600/1/1 - 9999/12/31. Follows the same validation rules for dates as my other date validator (m/d/y format) located in this library.
Matches
04/2/29 | 2002-4-30 | 02.10.31
Non-Matches
2003/2/29 | 02.4.31 | 00/00/00
Author Rating: The rating for this expression. Michael Ash
Title Test Details Pattern Title
Expression
^[0-9]{4}((0[1-9])|(1[0-2]))$
Description
Match a string in CCYYMM/YYYYMM format.
Matches
200401 | 000001 | 200412
Non-Matches
aaa | 20040123 | 200414
Author Rating: The rating for this expression. Joao Maia
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: The rating for this expression. martix wang
Title Test Details Pattern Title
Expression
((^(10|12|0?[13578])([/])(3[01]|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(11|0?[469])([/])(30|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(2[0-8]|1[0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(29)([/])([2468][048]00)$)|(^(0?2)([/])(29)([/])([3579][26]00)$)|(^(0?2)([/])(29)([/])([1][89][0][48])$)|(^(0?2)([/])(29)([/])([2-9][0-9][0][48])$)|(^(0?2)([/])(29)([/])([1][89][2468][048])$)|(^(0?2)([/])(29)([/])([2-9][0-9][2468][048])$)|(^(0?2)([/])(29)([/])([1][89][13579][26])$)|(^(0?2)([/])(29)([/])([2-9][0-9][13579][26])$))
Description
This Validator Validates any date from 1800 - 9999. It takes special care of Leap years and validates any format of type mm/dd/yyyy , m/dd/yyyy , mm/d/yyyy , m/d/yyyy. Since SQL Server does not accept any date before 1/1/1753, so i hope it will meet Your Requirements.(Modified Version of Jason West's Date Validator.)
Matches
2/2/2000 | 02/02/2000 | 02/2/2000
Non-Matches
2.2.2000 | 2-2-2000
Author Rating: The rating for this expression. Saurabh Nath
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-1]\d|[2][0-3])(\:[0-5]\d){1,2})?$
Description
This is a regular expression to validate a date string in "MM/DD/YYYY" format, a date time string in "MM/DD/YYYY HH:MM" or a date time string in "MM/DD/YYYY HH:MM:SS" format. It can validate date from 1600 to 2199.
Matches
12/30/2002 | 01/12/1998 13:30 | 01/28/2002 22:35:00
Non-Matches
13/30/2002 | 01/12/1998 24:30 | 01/28/2002 22:35:64
Author Rating: The rating for this expression. Spring Zhang
Title Test Details Time
Expression
^((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))$|^([01]\d|2[0-3])(:[0-5]\d){0,2}$
Description
This RE validates times patterns.
Matches
1 AM | 23:00:00 | 5:29:59 PM
Non-Matches
13 PM | 13:60:00 | 00:00:00 AM
Author Rating: The rating for this expression. Michael Ash
Title Test Details Pattern Title
Expression
^(([0-2]\d|[3][0-1])\/([0]\d|[1][0-2])\/[2][0]\d{2})$|^(([0-2]\d|[3][0-1])\/([0]\d|[1][0-2])\/[2][0]\d{2}\s([0-1]\d|[2][0-3])\:[0-5]\d\:[0-5]\d)$
Description
Correct French DateTime(DD/MM/YYYY OR DD/MM/YYYY HH:MM:SS)
Matches
12/01/2002 | 12/01/2002 12:32:10
Non-Matches
32/12/2002 | 12/13/2001 | 12/02/06
Author Rating: The rating for this expression. Samir AZZA
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[1-9]|[12][0-9]|3[01])\s(J(anuary|uly)|Ma(rch|y)|August|(Octo|Decem)ber)\s[1-9][0-9]{3}| (0[1-9]|[12][0-9]|30)\s(April|June|(Sept|Nov)ember)\s[1-9][0-9]{3}| (0[1-9]|1[0-9]|2[0-8])\sFebruary\s[1-9][0-9]{3}| 29\sFebruary\s((0[48]|[2468][048]|[13579][26])00|[0-9]{2}(0[48]|[2468][048]|[13579][26]))
Description
Verifies all valid Gregorian dates of the form DD MONTH YY, taking days/month and leap years into account.
Matches
09 March 2005 | 29 February 2004 | 31 December 9999
Non-Matches
32 March 2005 | 29 February 2005 | 2005-03-09
Author Rating: Not yet rated. Daniel Vandersluis
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
^(0{0,1}[1-9]|[12][0-9]|3[01])[- /.](0{0,1}[1-9]|1[012])[- /.](\d{2}|\d{4})$
Description
Validates dates formatted like "dd.mm.yyyy" or "dd.mm.yy". Also the separators "/" and "-" are validated "ok". This expression does not check leap years! I did this expression cause I could hardly find any date regex that supports those "dot-formats".
Matches
1.1.2004 | 03.07.04 | 1-03-03
Non-Matches
0.13.2004 | 1.1.200 | 32.0.03
Author Rating: Not yet rated. Steve Wagner
Title Test Details Pattern Title
Expression
(^(((([1-9])|([0][1-9])|([1-2][0-9])|(30))\-([A,a][P,p][R,r]|[J,j][U,u][N,n]|[S,s][E,e][P,p]|[N,n][O,o][V,v]))|((([1-9])|([0][1-9])|([1-2][0-9])|([3][0-1]))\-([J,j][A,a][N,n]|[M,m][A,a][R,r]|[M,m][A,a][Y,y]|[J,j][U,u][L,l]|[A,a][U,u][G,g]|[O,o][C,c][T,t]|[D,d][E,e][C,c])))\-[0-9]{4}$)|(^(([1-9])|([0][1-9])|([1][0-9])|([2][0-8]))\-([F,f][E,e][B,b])\-[0-9]{2}(([02468][1235679])|([13579][01345789]))$)|(^(([1-9])|([0][1-9])|([1][0-9])|([2][0-9]))\-([F,f][E,e][B,b])\-[0-9]{2}(([02468][048])|([13579][26]))$)
Description
I have written this regular expression for use in javascript. It sould work for other languages directly or with minor changes. The parsing logic in this regular expression works like this : Imagine a tree structure, input at the root, Level 1 : two branches one-non Feb months two-Feb month. In the Feb month again two branches one-leap year Feb and two-non leap year Feb. In the non-Feb branch, we have two branches again, one-30 days month and two-31 days month. Once you get this, I think it will be easier to figure out the rest.
Matches
29-Feb-2000 | 1-jan-2007 | 31-dEC-1770
Non-Matches
32-Jan-2001 | 30-Feb-2004 | 0-nov-2004
Author Rating: Not yet rated. Moiz Tankiwala
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]{2,2})$)|(^([0-9]|[1][0-9]|[2][0-3])(\s{0,1})([AM|PM|am|pm]{2,2})$)
Description
Matches
12:30PM
Non-Matches
1300
Author Rating: Not yet rated. Osaro bare
Change page:   |    Displaying page 4 of 7 pages; Items 61 to 80

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