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 |
^(20|21|22|23|[0-1]\d)[0-5]\d$ |
Description |
This regular expression will match a 24 hour time with no separators. |
Matches |
1200 | 1645 | 2359 |
Non-Matches |
2400 | asbc | 12:45 |
Author |
Rating:
Steven Smith
|
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:
Brad Williams
|
Title |
Test
Details
Pattern Title
|
Expression |
^((\d{2}((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])))|([02468][048]|[13579][26])0229)$ |
Description |
Date expression validator with format YYMMDD
Validates leap years.
Of course, as year has only 2 digits, it's not possible to invalidate years like 2100, 2200, 2300, etc as a non-leap years ! |
Matches |
751231 | 000229 | 040229 |
Non-Matches |
750431 | 010229 | 050229 |
Author |
Rating:
Dany Lauener
|
Title |
Test
Details
Pattern Title
|
Expression |
^([0-9]{2})(00[1-9]|0[1-9][0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-6])$ |
Description |
Matches a Julian date in the format YYDDD. Two digit year followed by a number from 1 - 366 indicating the day of the year. |
Matches |
99366 | 00001 |
Non-Matches |
74000 | 04367 |
Author |
Rating:
Brian James
|
Title |
Test
Details
yyyy/mm/dd hhMMss Date
|
Expression |
^(?ni:(?=\d)((?'year'((1[6-9])|([2-9]\d))\d\d)(?'sep'[/.-])(?'month'0?[1-9]|1[012])\2(?'day'((?<!(\2((0?[2469])|11)\2))31)|(?<!\2(0?2)\2)(29|30)|((?<=((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(16|[2468][048]|[3579][26])00)\2\3\2)29)|((0?[1-9])|(1\d)|(2[0-8])))(?:(?=\x20\d)\x20|$))?((?<time>((0?[1-9]|1[012])(:[0-5]\d){0,2}(\x20[AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2}))?)$ |
Description |
YYYY/MM/DD hh:mm:ss format DateTime Regex.
This regex will validate a date, time or a datetime.
It will also capture the date fields and the time.
Dates are in the YYYY/MM/DD format and validated for months, number of days in a month and leap years (29/2)
Date field can be separated by matched periods(.), dashes(-) or forward slashes(/)
Time is either 12 hour AM/PM format (hh:mm:ss AM), where minutes and seconds are optional.
AM or PM required. or 24 hour military format (hh:mm:ss), from 00:00:00 to 23:59:59,
where hours and minutes fields are required, including leading 0 for hours less than 10.
Please refer to http://blogs.regexadvice.com/mash/archive/2004/04/23/1021.aspx for additional info
Datetime is the above date and time formats separated by a space,
with the date first (YYYY/MM/DD hh:mm:ss)
!IMPORTANT NOTE: your regex engine must support lookbehinds and named groups to use this expression |
Matches |
12:30 PM | 2004-02-29 | 2004/3/31 02:31:35 AM |
Non-Matches |
2:00 | 2200.2.29 | 0000/00/00 00:00:00 AM |
Author |
Rating:
Michael Ash
|
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:
Michael Ash
|
Title |
Test
Details
Pattern Title
|
Expression |
^(\d{2}((0[1-9]|1[012])(0[1-9]|1\d|2[0-8])|(0[13456789]|1[012])(29|30)|(0[13578]|1[02])31)|([02468][048]|[13579][26])0229)$ |
Description |
yyMMdd with leap years.
Minimized expression.
As we have only 2 numbers for the years, dates 1600, 2000, etc are still validated. |
Matches |
001231 | 000229 | 040229 |
Non-Matches |
003112 | 000431 | 010229 |
Author |
Rating:
Dany Lauener
|
Displaying page
of
pages;
Items to