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
^(((\d{4}((0[13578]|1[02])(0[1-9]|[12]\d|3[01])|(0[13456789]|1[012])(0[1-9]|[12]\d|30)|02(0[1-9]|1\d|2[0-8])))|((\d{2}[02468][048]|\d{2}[13579][26]))0229)){0,8}$
Description
Validates a date expression (or empty value) in CCYYMMDD format, checking a leap year from 00000101 A.D. to 99991231
Matches
20041231 | 20040229
Non-Matches
20043112 | 2003/04/02
Author Rating: Not yet rated. Danny Garber
Title Test Details Pattern Title
Expression
^(\d{1,2})(\s?(H|h)?)(:([0-5]\d))?$
Description
Validates hours and minutes. Allows for entry in the form of hours:minutes with optional minutes and optional hours indicator (H or h).
Matches
1h | 1:45 | 45
Non-Matches
1a | 145 | 1:99
Author Rating: Not yet rated. Andrew Yeaman
Title Test Details Pattern Title
Expression
^((((0?[13578])|(1[02]))[\/|\-]?((0?[1-9]|[0-2][0-9])|(3[01])))|(((0?[469])|(11))[\/|\-]?((0?[1-9]|[0-2][0-9])|(30)))|(0?[2][\/\-]?(0?[1-9]|[0-2][0-9])))[\/\-]?\d{2,4}$
Description
After looking for a date regular expression, I could not find one that meet my need, so I develop one that handles 1 or 2 digets in the month and day and also handle feb up to 29. This will allow both / and - for separators, which is what I needed. I hope this helps others too. Thanks, Cliff Schneide
Matches
1-31-02 | 2-29-04 | 08/1/2004
Non-Matches
2-30-04 | 6/31/04 | 13-11-2004
Author Rating: Not yet rated. Cliff Schneide
Title Test Details Pattern Title
Expression
^\s*(?'num'\d+(\.\d+)?)\s*(?'unit'((w(eek)?)|(wk)|(d(ay)?)|(h(our)?)|(hr))s?)(\s*$)
Description
Validates Microsoft Project-type duration entries. Accepts a number and a unit. The number part can be integer or decimal. The unit can be several variations of weeks, days, and hours: e.g., w, wk, week, ws, wks, weeks are all valid. Whitespace between the number and the unit is optional: e.g., 1d, 2 days, 3.5w are all valid. Captures the number value in a group named num and the unit string in a group named 'unit'.
Matches
1 day | 3.5 w | 6hrs
Non-Matches
1 | 6. days | 1 week 2 d
Author Rating: Not yet rated. Steve Fisher
Title Test Details Pattern Title
Expression
^(([0-9])|([0-1][0-9])|([2][0-3])):?([0-5][0-9])$
Description
For testing 24H based time entry. Tests if there is a colon to separate the hours from the minutes
Matches
0959 | 959 | 9:59
Non-Matches
90 | 960 | 24:00
Author Rating: Not yet rated. mana deys
Title Test Details Pattern Title
Expression
^(([0-9])|([0-1][0-9])|([2][0-3])):(([0-9])|([0-5][0-9]))$
Description
reg. expr. 4 checking 24 time
Matches
1:59 | 01:59 | 23:59
Non-Matches
12:63 | 25:60 | 13.10
Author Rating: Not yet rated. Tomas Andrysek
Title Test Details Pattern Title
Expression
^(?:(?:(?:0?[1-9]|1\d|2[0-8])\/(?:0?[1-9]|1[0-2]))\/(?:(?:1[6-9]|[2-9]\d)\d{2}))$|^(?:(?:(?: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]))))$
Description
This expression validates dates in the Brazilian d/m/y format from 1/1/1600 - 12/31/9999. The days are validated for the given month and year. Leap years are validated for all 4 digits years from 1600-9999. Days and months must be 1 or 2 digits and may have leading zeros. Years must be 4 digit years, between 1600 and 9999. Date separator must be a slash (/)
Matches
29/02/2004 | 15/3/1824 | 31/01/2001
Non-Matches
29/02/2000 | 21/10/92 | 31/02/2001
Author Rating: Not yet rated. Felipe Braga
Title Test Details Pattern Title
Expression
^\d{2}\s{1}(Jan|Feb|Mar|Apr|May|Jun|Jul|Apr|Sep|Oct|Nov|Dec)\s{1}\d{4}$
Description
valid date base on Month
Matches
01 Jan 2003
Non-Matches
01 01 2003
Author Rating: Not yet rated. stephen lam
Title Test Details Pattern Title
Expression
^(((((0[13578])|([13578])|(1[02]))[\-\/\s]?((0[1-9])|([1-9])|([1-2][0-9])|(3[01])))|((([469])|(11))[\-\/\s]?((0[1-9])|([1-9])|([1-2][0-9])|(30)))|((02|2)[\-\/\s]?((0[1-9])|([1-9])|([1-2][0-9]))))[\-\/\s]?\d{4})(\s(((0[1-9])|([1-9])|(1[0-2]))\:([0-5][0-9])((\s)|(\:([0-5][0-9])\s))([AM|PM|am|pm]{2,2})))?$
Description
Following expression can be used to validate a datetime column from SQL Server. This expression is an enhanced version of Scott Watermasysk's date/time submission. It now accepts leading zeros in months, days, and hours. In addition, this expression properly handles the 11th hour. Watermasysk's would take the 10th and 12th hour but not the 11th. This regex has been tweaked to do so. Does not handle the February 29th problem on non-leap years yet. Will learn a little more about RegEx and do so in later submission.
Matches
11/30/2003 10:12:24 am | 2/29/2003 08:14:56 pm | 5/22/2003
Non-Matches
11/31/2003 10:12:24 am | 2/30/2003 08:14:56 pm | 5/22/2003 14:15
Author Rating: Not yet rated. David Darling
Title Test Details Pattern Title
Expression
^(3[0-1]|2[0-9]|1[0-9]|0[1-9])[\s{1}|\/|-](Jan|JAN|Feb|FEB|Mar|MAR|Apr|APR|May|MAY|Jun|JUN|Jul|JUL|Aug|AUG|Sep|SEP|Oct|OCT|Nov|NOV|Dec|DEC)[\s{1}|\/|-]\d{4}$
Description
More flexible date validator. Allows either spaces, / or - as dividers, also allows for fully uppercase months, year as 4 digit.
Matches
01 JAN 2003 | 31/Dec/2002 | 20-Apr-2003
Non-Matches
32 Jan 2003 | 00 Dec 2003 | 10 dec 2003
Author Rating: Not yet rated. Ian Wallace
Title Test Details Pattern Title
Expression
^(((0[13578]|10|12)([-./])(0[1-9]|[12][0-9]|3[01])([-./])(\d{4}))|((0[469]|11)([-./])([0][1-9]|[12][0-9]|30)([-./])(\d{4}))|((02)([-./])(0[1-9]|1[0-9]|2[0-8])([-./])(\d{4}))|((02)(\.|-|\/)(29)([-./])([02468][048]00))|((02)([-./])(29)([-./])([13579][26]00))|((02)([-./])(29)([-./])([0-9][0-9][0][48]))|((02)([-./])(29)([-./])([0-9][0-9][2468][048]))|((02)([-./])(29)([-./])([0-9][0-9][13579][26])))$
Description
This works for all accept 01/01/0000 mainly 0000. can anybody suggest a solution.
Matches
01/01/2001
Non-Matches
01/01/00000
Author Rating: Not yet rated. Func toid
Title Test Details Pattern Title
Expression
^(([0]?[1-9]|1[0-2])/([0-2]?[0-9]|3[0-1])/[1-2]\d{3})? ?((([0-1]?\d)|(2[0-3])):[0-5]\d)?(:[0-5]\d)? ?(AM|am|PM|pm)?$
Description
Matches variations on date/time/AM-PM. Must have 4 digit year, but everything else is open. Restrictions are: 4 digit year, months 1-12, hours 1-23, minutes and seconds 1-59, any case of AM and PM. If this don't woik, I wrote it, lemmy know.
Matches
12/30/2002 | 12/30/2002 9:35 pm | 12/30/2002 19:35:02
Non-Matches
18/22/2003 | 8/12/99 | 8/22/2003 25:00
Author Rating: Not yet rated. Michael Gaertner
Title Test Details Pattern Title
Expression
^[\w-\.]+@([\w-]+\.)+[\w-]{2,3}$
Description
For Date format MM-JJ-YYYY validation
Matches
Non-Matches
umtsfr@free | umtsfrfree.fr | @free.fr
Author Rating: Not yet rated. Hakim SALHI
Title Test Details Pattern Title
Expression
^((((((0?[13578])|(1[02]))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]?((0?[1-9])|([1-2][0-9]))))[\-\/\s]?\d{2}(([02468][048])|([13579][26])))|(((((0?[13578])|(1[02]))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))[\-\/\s]?\d{2}(([02468][1235679])|([13579][01345789]))))(\s(((0?[1-9])|(1[0-2]))\:([0-5][0-9])((\s)|(\:([0-5][0-9])\s))([AM|PM|am|pm]{2,2})))?$
Description
This regex will match SQL Server datetime values, allowing date only, allowing zero padded digits in month, day and hour, and will match leap years from 1901 up until 2099.
Matches
2/29/2004 | 04/01/2003 10:01:23 am | 03-20-1999
Non-Matches
2/29/2003 | 13/30/2001 10:05:00 pm | 12/32/2003
Author Rating: Not yet rated. Sung Lee
Change page:   |    Displaying page 7 of 7 pages; Items 121 to 134

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