134 regular expressions found in this category!
Displaying page
of
pages;
Items to
| 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[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?[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]?[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
Pattern Title
|
| Expression |
^((((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])|((16|[2468][048]|[3579][26])00))))|(0?[1-9]|1\d|2[0-8])\/((0?[1-9])|(1[0-2]))\/((1[6-9]|[2-9]\d)?\d{2})) (20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d$ |
| Description |
this expression validates a date-time field in European d/m/y h:m:s format. It is a european variation of Michael Ash's date-validation expression in this library.
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 |
| Matches |
29/02/2004 20:15:27 | 29/2/04 8:9:5 | 31/3/2004 9:20:17 |
| Non-Matches |
29/02/2003 20:15:15 | 2/29/04 20:15:15 | 31/3/4 9:20:17 |
| Author |
Rating:
martin devos
|
| 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[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 |
^([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[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 |
^[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])([-./])(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
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
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 |
(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 |
^(?=\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)(?:(?: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 |
(?=\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 |
^(([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
|
Displaying page
of
pages;
Items to