134 regular expressions found in this category!
Displaying page
of
pages;
Items to
| Title |
Test
Details
Pattern Title
|
| Expression |
((0[1-9])|(1[02]))/\d{2} |
| Description |
Fromat check for MM/YY, checks month is 1-12 and any 2 digit year. |
| Matches |
01/00 | 12/99 |
| Non-Matches |
13/00 | 12/AS |
| Author |
Rating:
Andrew Balaschak
|
| 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:
Adam Smith
|
| Title |
Test
Details
Pattern Title
|
| Expression |
(((0[123456789]|10|11|12)([/])(([1][9][0-9][0-9])|([2][0-9][0-9][0-9])))) |
| Description |
This is an new data Validation to MM/YYYY from 1900 to 2999 this is an validation expression to Client From MOnth/Year. |
| Matches |
01/1900 | 10/1990 | 12/2999 |
| Non-Matches |
1/1900 | 12/1899 | 01/3000 |
| Author |
Rating:
Felipe Albacete
|
| 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:
Func toid
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^((([0]?[1-9]|1[0-2])(:|\.)[0-5][0-9]((:|\.)[0-5][0-9])?( )?(AM|am|aM|Am|PM|pm|pM|Pm))|(([0]?[0-9]|1[0-9]|2[0-3])(:|\.)[0-5][0-9]((:|\.)[0-5][0-9])?))$ |
| Description |
Matches times seperated by either : or . will match a 24 hour time, or a 12 hour time with AM or PM specified. Allows 0-59 minutes, and 0-59 seconds. Seconds are not required. |
| Matches |
1:01 AM | 23:52:01 | 03.24.36 AM |
| Non-Matches |
19:31 AM | 9:9 PM | 25:60:61 |
| Author |
Rating:
Steve Valaitis
|
| Title |
Test
Details
MM/YYYY MONTH/YEAR
|
| Expression |
^((0[1-9])|(1[0-2]))\/(\d{4})$ |
| Description |
This regular expressions matches dates in the format MM/YYYY where MM can be 01 to 12 and YYYY is always 4 digits long. |
| Matches |
12/2002 | 11/1900 | 02/1977 |
| Non-Matches |
1/1977 | 00/000 | 15/2002 |
| Author |
Rating:
Jony Ferreira
|
| 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 |
[-+]((0[0-9]|1[0-3]):([03]0|45)|14:00) |
| Description |
This matches timezone offsets. Also matches non-hour offsets like India (+05:30) and Nepal (+5:45}. See for more timezone information: http://en.wikipedia.org/wiki/Time_zone |
| Matches |
+00:00 | -05:00 | +13:45 |
| Non-Matches |
+14:30 | +01:14 | -09:55 |
| Author |
Rating:
Robert van der Boon
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^([01]\d|2[0123])([0-5]\d){2}$ |
| Description |
HHmmss without any separators. Hours in 24h format. |
| Matches |
235959 | 000000 | 012345 |
| Non-Matches |
240000 | 23:59:59 | 236060 |
| Author |
Rating:
Dany Lauener
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^[0-9]{4}-(((0[13578]|(10|12))-(0[1-9]|[1-2][0-9]|3[0-1]))|(02-(0[1-9]|[1-2][0-9]))|((0[469]|11)-(0[1-9]|[1-2][0-9]|30)))$ |
| Description |
Matches the date format "YYYY-mm-dd" and also validates month and number of days in a month. All leap year dates "YYYY-02-29" passes trough. Could easily be changed to another format. |
| Matches |
2004-04-30 | 2004-02-29 |
| Non-Matches |
2004-04-31 | 2004-02-30 |
| Author |
Rating:
Johan Södercrantz
|
| 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 |
(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:
Daniel Vandersluis
|
| 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 (jason.west@mail.state.ky.us) 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:
Alessandro Olivi
|
| 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:
Michael Ash
|
| 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\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 |
DateTime Validator. This RE validates both dates and/or times patterns. Days in Feb. are also validated for Leap years. Dates: in dd/mm/yyyy or d/m/yy format between 1/1/1600 - 31/12/9999. Leading zeroes are optional. Date separators can be either matching dashes(-), slashes(/) or periods(.) Times: in the hh:MM:ss AM/PM 12 hour format (12:00 AM - 11:59:59 PM) or hh:MM:ss military time format (00:00:00 - 23:59:59). The 12 hour time format: 1) may have a leading zero for the hour. 2) Minutes and seconds are optional for the 12 hour format 3) AM or PM is required and case sensitive. Military time 1) must have a leading zero for all hours less than 10. 2) Minutes are manditory. 3) seconds are optional. Datetimes: combination of the above formats. A date first then a time separated by a space. ex) dd/mm/yyyy hh:MM:ss This RE is an variation of one of my other Datetime (mm/dd/yyyy) validator already in this library http://www.regexlib.com/REDetails.aspx?regexp_id=369, so the same rules for leap year apply. All 4 digit year and all two digit years except 00, which might not be a leap year. |
| Matches |
31/12/2003 11:59:59 PM | 29-2-2004 | 01:45:02 |
| Non-Matches |
12/31/2003 | 29.02.2005 | 13:30 PM |
| Author |
Rating:
Michael Ash
|
| 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:
mana deys
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^(?=\d)(?:(?!(?:(?:0?[5-9]|1[0-4])(?:\.|-|\/)10(?:\.|-|\/)(?:1582))|(?:(?:0?[3-9]|1[0-3])(?:\.|-|\/)0?9(?:\.|-|\/)(?:1752)))(31(?!(?:\.|-|\/)(?:0?[2469]|11))|30(?!(?:\.|-|\/)0?2)|(?:29(?:(?!(?:\.|-|\/)0?2(?:\.|-|\/))|(?=\D0?2\D(?:(?!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))))))|2[0-8]|1\d|0?[1-9])([-.\/])(1[012]|(?:0?[1-9]))\2((?=(?:00(?:4[0-5]|[0-3]?\d)\x20BC)|(?:\d{4}(?:$|(?=\x20\d)\x20)))\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 |
dd/mm/yyyy hh:MM:ss Datetime for all AD years, including leap years.
Javascript safe version of http://regexlib.com/REDetails.aspx?regexp_id=691. Please see that regex for details of what is being checked |
| Matches |
31.12.6008 | 5:30 AM | 30-04-1066 |
| Non-Matches |
00/00/0000 | 99:99:99 | 29/02/2005 |
| 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
A.D. Calendar dates
|
| Expression |
(?#Calandar from January 1st 1 A.D to December 31, 9999 )(?# in yyyy-mm-dd format )(?!(?:1582\D10\D(?:0?[5-9]|1[0-4]))|(?#Missing days from 1582 )(?:1752\D0?9\D(?:0?[3-9]|1[0-3]))(?#or Missing days from 1752 )(?# both sets of missing days should not be in the same calendar so remove one or the other))(?n:^(?=\d)(?# the character at the beginning a the string must be a digit )((?'year'\d{4})(?'sep'[-./])(?'month'0?[1-9]|1[012])\k'sep'(?'day'(?<!(?:0?[469]|11).)31|(?<!0?2.)30|2[0-8]|1\d|0?[1-9]|(?# if feb 29th check for valid leap year )(?:(?<=(?!(?#exclude these years from leap year pattern ) 000[04](?#No year 0 and no leap year in year 4 )|(?:(?:1[^0-6]|[2468][^048]|[3579][^26])00)(?# centurial years > 1500 not evenly divisible by 400 are not leap year))(?:(?:\d\d)(?# century)(?:[02468][048]|[13579][26])(?#leap years))\k'sep'(?:0?2)\k'sep')|(?# else if not Feb 29 )(?<!\k'sep'(?:0?2)\k'sep')(?# and day not Feb 30 or 31 ))29)(?(?=\x20\d)\x20|$))?(?# if there is a space followed by a digit check for time )(?<time>((?# 12 hour format )(0?[1-9]|1[012])(?# hours )(:[0-5]\d){0,2}(?# optional minutes and seconds )(?i:\x20[AP]M)(?# required AM or PM ))|(?# 24 hour format )([01]\d|2[0-3])(?#hours )(:[0-5]\d){1,2})(?#required minutes optional seconds )?$) |
| Description |
yyyy-mm-dd Datetime for AD, with leap year. See http://blogs.regexadvice.com/mash/archive/2004/04/23/1021.aspx for details on similar regexs |
| Matches |
0001-06-16 12:00:01 AM | 2004/2/29 | 3:30 PM |
| Non-Matches |
9999/99/99 | 24:00:00 | 2003-02-29 |
| Author |
Rating:
Michael Ash
|
| Title |
Test
Details
DateTime type format
|
| Expression |
(\d{2}|\d{4})(?:\-)?([0]{1}\d{1}|[1]{1}[0-2]{1})(?:\-)?([0-2]{1}\d{1}|[3]{1}[0-1]{1})(?:\s)?([0-1]{1}\d{1}|[2]{1}[0-3]{1})(?::)?([0-5]{1}\d{1})(?::)?([0-5]{1}\d{1}) |
| Description |
Will match a date accepted by MySQL datetime type.
Years with 2 or 4 digits from any range.
Months with 2 digits from 00 to 12.
days with 2 digits from 00 to 31.
Hours with 2 digits from 00-23
Minutes with 2 digits from 00 to 59.
Seconds with 2 digits from 00 to 59. |
| Matches |
00-00-00 00:00:00 | 0000-00-00 00:00:00 | 09-05-22 08:16:00 | 1970-00-00 00:00:00 | 20090522081600 |
| Non-Matches |
2009-13:01 00:00:00 | 2009-12-32 00:00:00 | 2002-12-31 24:00:00 | 2002-12-31 23:60:00 | 02-12-31 23:00:60 |
| Author |
Rating:
João Batista Neto
|
Displaying page
of
pages;
Items to