134 regular expressions found in this category!
Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
(((0[1-9]|[12][0-9]|3[01])([/])(0[13578]|10|12)([/])([1-2][0,9][0-9][0-9]))|(([0][1-9]|[12][0-9]|30)([/])(0[469]|11)([/])([1-2][0,9][0-9][0-9]))|((0[1-9]|1[0-9]|2[0-8])([/])(02)([/])([1-2][0,9][0-9][0-9]))|((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 |
This is the Brazilian Date Format.
DD/MM/YYYY with the right days per month.
Dates >=1900 <=2999. |
Matches |
29/02/2004 | 31/01/1900 | 31/01/2999 |
Non-Matches |
29/02/2003 | 12042004 | 20/04/04 |
Author |
Rating:
Felipe Albacete
|
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
Validate 12hour clock
|
Expression |
(?<Time>^(?:0?[1-9]:[0-5]|1(?=[012])\d:[0-5])\d(?:[ap]m)?) |
Description |
A co-worker needed a regex to validate time. He could only find patterns that match a 24hour clock. I whipped this expression up to validate a 12hour clock. Hope somebody finds it useful. |
Matches |
12:00am | 01:30pm | 4:59 |
Non-Matches |
15:30 | 4:78am | 00:00 |
Author |
Rating:
Ariel Merrell
|
Title |
Test
Details
Pattern Title
|
Expression |
(?<Day>[1-9]|[0-3][0-9])/(?<Month>[01][012]|[1-9]|0[1-9])/(?<Year>[12]\d{3}|\d{2})
|
Description |
DD/MM/YY
D/M/YY
DD/MM/YYYY |
Matches |
15/05/2004 | 15/5/04 |
Non-Matches |
15/45/04 |
Author |
Rating:
yoram o
|
Title |
Test
Details
Pattern Title
|
Expression |
^(([1-9]|[0-2]\d|[3][0-1])\.([1-9]|[0]\d|[1][0-2])\.[2][0]\d{2})$|^(([1-9]|[0-2]\d|[3][0-1])\.([1-9]|[0]\d|[1][0-2])\.[2][0]\d{2}\s([1-9]|[0-1]\d|[2][0-3])\:[0-5]\d)$ |
Description |
Correct German DateTime. Does not check leap year rules!
Possible Formats of date part:
D.M.YYYY or D.MM.YYYY or DD.MM.YYYY or DD.M.YYYY
Possible formats of time part:
h:mm or hh:mm |
Matches |
20.10.2003 08:10 | 24.12.2003 | 1.1.2004 8:15 |
Non-Matches |
25.13.2004 | 20.10.2003 08:9 |
Author |
Rating:
Markus Unterauer
|
Title |
Test
Details
Pattern Title
|
Expression |
^([0-1]?[0-9]|[2][0-3]):([0-5][0-9])$ |
Description |
Accepts data of time in format h:mm and hh:mm
^([0-1]?[0-9]|[2][0-3]):([0-5][0-9])$
in php [0-23]:[0-59]{2} (posix) |
Matches |
0:00 | 23:00 | 00:59 |
Non-Matches |
0:0 | 24:00 | 00:60 |
Author |
Rating:
Morten Henriksen
|
Title |
Test
Details
Pattern Title
|
Expression |
^((\d{2}(([02468][048])|([13579][26]))[\-\/\s]?((((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])))))|(\d{2}(([02468][1235679])|([13579][01345789]))[\-\/\s]?((((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(((0?[1-9])|(1[0-2]))\:([0-5][0-9])((\s)|(\:([0-5][0-9])\s))([AM|PM|am|pm]{2,2})))?$ |
Description |
Matches ANSI SQL date format YYYY-mm-dd hh:mi:ss am/pm. You can use / - or space for date delimiters, so 2004-12-31 works just as well as 2004/12/31. Checks leap year from 1901 to 2099. |
Matches |
2004-2-29 | 2004-02-29 10:29:39 pm | 2004/12/31 |
Non-Matches |
2003-2-29 | 2003-13-02 | 2003-2-2 10:72:30 am |
Author |
Rating:
Sung Lee
|
Title |
Test
Details
Pattern Title
|
Expression |
(0?[1-9]|[12][0-9]|3[01])[/ -](0?[1-9]|1[12])[/ -](19[0-9]{2}|[2][0-9][0-9]{2}) |
Description |
Essa expressão é uma validação de data simplicada onde não aceita datas com ano inferior a 1900. Interessante pra validação de data de idade, data atual, etc |
Matches |
25/11/1979 | 5-12-2004 | 5 2 1901 |
Non-Matches |
25/11/1899 | 9-12-1700 | 25111979 |
Author |
Rating:
Fabiano Santiago
|
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
DateTime M/d/y hh:mm:ss
|
Expression |
^(?=\d)(?:(?:(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})|(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))|(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2}))($|\ (?=\d)))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$ |
Description |
DateTime Validator. |
Matches |
12/25/2003 | 08:03:31 | 02/29/2004 12 AM |
Non-Matches |
02/29/2003 1:34 PM | 13:23 PM | 24:00:00 |
Author |
Rating:
Michael Ash
|
Title |
Test
Details
Pattern Title
|
Expression |
((([0][1-9]|[12][\d])|[3][01])[-/]([0][13578]|[1][02])[-/][1-9]\d\d\d)|((([0][1-9]|[12][\d])|[3][0])[-/]([0][13456789]|[1][012])[-/][1-9]\d\d\d)|(([0][1-9]|[12][\d])[-/][0][2][-/][1-9]\d([02468][048]|[13579][26]))|(([0][1-9]|[12][0-8])[-/][0][2][-/][1-9]\d\d\d) |
Description |
Date validation in the dd/mm/yyyy format for years 1000+ (i.e 999 or 0999 not matching) and taking february leap years into account. |
Matches |
12/12/2003 | 29-02-2004 | 31-03-1980 |
Non-Matches |
29/02/2003 | 31-04-2002 | 10-10-0999 |
Author |
Rating:
Uris Virott
|
Title |
Test
Details
Pattern Title
|
Expression |
(?<Day>[0-3][0-9]|[1-9])/(?<Month>[1-9]|1[0-2]|0[1-9])/(?<Year>[12]\d{3}|\d{2}) |
Description |
evaluates dates in the format of DD/MM/YY or DD/MM/YYYY
DD & YY - can be of the form:
One digit 2
Zero leading 02 |
Matches |
1/3/98 | 01/03/04 |
Non-Matches |
15/20/04 | 1/13/04 | 12/02/ |
Author |
Rating:
yoram o
|
Title |
Test
Details
dd MMM yyyy Date
|
Expression |
^((31(?!\ (Feb(ruary)?|Apr(il)?|June?|(Sep(?=\b|t)t?|Nov)(ember)?)))|((30|29)(?!\ Feb(ruary)?))|(29(?=\ Feb(ruary)?\ (((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])\ (Jan(uary)?|Feb(ruary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sep(?=\b|t)t?|Nov|Dec)(ember)?)\ ((1[6-9]|[2-9]\d)\d{2})$ |
Description |
This RE validates dates in the dd MMM yyyy format. Spaces separate the values. |
Matches |
31 January 2003 | 29 March 2004 | 29 Feb 2008 |
Non-Matches |
Jan 1 2003 | 31 Sept 2003 | 29 February 2003 |
Author |
Rating:
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:
Alessandro Olivi
|
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:
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:
Michael Ash
|
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:
Spring Zhang
|
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-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:
Samir AZZA
|
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:
Michael Ash
|
Displaying page
of
pages;
Items to