Displaying page
of
pages;
Items to
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]|[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
date validations
|
Expression |
date |
Description |
if (RadDatePicker1.SelectedDate == System.DateTime.Now.Date)
{
string strconnection;
strconnection = ConfigurationSettings.AppSettings["ConnectionString"].ToString();
SqlConnection cn = new SqlConnection(strconnection);
SqlCommand cmd = new SqlCommand("empattendancedetails", cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@empid", SqlDbType.Int).Direction = ParameterDirection.Input;
cmd.Parameters.Add("@date", SqlDbType.DateTime).Direction = ParameterDirection.Input;
cmd.Parameters.Add("@intime", SqlDbType.DateTime).Direction = ParameterDirection.Input;
cmd.Parameters.Add("@outtime", SqlDbType.DateTime).Direction = ParameterDirection.Input;
cmd.Parameters["@empid"].Value = Session["loginid"];
cmd.Parameters["@date"].Value = RadDatePicker1.SelectedDate.ToString();
cmd.Parameters["@intime"].Value = RadTimePicker1.SelectedDate.ToString();
cmd.Parameters["@outtime"].Value = RadTimePicker2.SelectedDate.ToString();
cn.Open();
cmd.ExecuteNonQuery();
cn.Close(); Response.Write("Record Added.");
}
else
Response.Write("enter todays date");
} |
Matches |
validation |
Non-Matches |
not validations |
Author |
Rating:
Not yet rated.
vasireddyveenavani
|
Title |
Test
Details
.NET RegEx mm/dd/yyyy date validation
|
Expression |
\b(((0[13578]|1[02])[\/\.-]?(0[1-9]|[12]\d|3[01])[\/\.-]?(19|20)?(\d{2}))|(0[13456789]|1[012])[\/\.-]?(0[1-9]|[12]\d|30)[\/\.-]?(19|20)?(\d{2}))|(02[\/\.-]?(0[1-9]|1\d|2[0-8])[\/\.-]?(19|20)?(\d{2}))|(02[\/\.-]?29[\/\.-]?(19|20)?((0[48]|[2468][048]|[13579][26])|(00)))\b |
Description |
I needed to have a way where users could type in any date format like the following: mm/dd/yyyy, mm/dd/yy, mmddyy, mmddyyyy with the ability to use "/" and "." and "-" or nothing as separation characters. I use this in a RegularExpression Validator control in ASP.NET |
Matches |
032103|02/29/2008|10.31.1990|010102 |
Non-Matches |
2-29-00|11.31.1992|063178|02/29/2005 |
Author |
Rating:
Not yet rated.
Ken Fayal
|
Title |
Test
Details
Date validation
|
Expression |
\b([0]?[1-9]|[1,2]\d|3[0,1])[-/]([0]?[1-9]|[1][0,1,2])[-/](\d{1,2}|[1][9]\d\d|[2][0]\d\d)\b |
Description |
Validates strings of type dd/mm/yyyy. checking dd to be between 1-31, mm between 1-12 and yyyy between 1900-2099. |
Matches |
1/1/1900 | 31/12/10 | 20/1/1010 |
Non-Matches |
33/1/1900 | 1/13/1800 | 1/1/987 |
Author |
Rating:
Not yet rated.
Alex Manetas
|
Title |
Test
Details
date validation javascript
|
Expression |
^((((0?[13578]|1[02])\/([0-2]?[1-9]|20|3[0-1]))|((0?[469]|11)\/([0-2]?[1-9]|20|30))|(0?2\/([0-1]?[1-9]|2[0-8])))\/((19|20)?\d{2}))|(0?2\/29\/((19|20)?(04|08|12|16|20|24|28|32|36|40|44|48|52|56|60|64|68|72|76|80|84|88|92|96)|2000))$ |
Description |
Check that a valid date has been entered. Uses mm/dd/yyyy or m/d/yy format or various combinations. Checks for valid leap years. |
Matches |
2/28/1990 2/29/1992 03/1/10 |
Non-Matches |
2/29/90 11/31/2010 |
Author |
Rating:
Not yet rated.
Terry Shannon
|
Title |
Test
Details
ISO 8601 Date validation with long-short months and leap years
|
Expression |
^(?:(?=[02468][048]00|[13579][26]00|[0-9][0-9]0[48]|[0-9][0-9][2468][048]|[0-9][0-9][13579][26])\d{4}(?:(-|)(?:(?:00[1-9]|0[1-9][0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-6])|(?:01|03|05|07|08|10|12)(?:\1(?:0[1-9]|[12][0-9]|3[01]))?|(?:04|06|09|11)(?:\1(?:0[1-9]|[12][0-9]|30))?|02(?:\1(?:0[1-9]|[12][0-9]))?|W(?:0[1-9]|[1-4][0-9]|5[0-3])(?:\1[1-7])?))?)$|^(?:(?![02468][048]00|[13579][26]00|[0-9][0-9]0[48]|[0-9][0-9][2468][048]|[0-9][0-9][13579][26])\d{4}(?:(-|)(?:(?:00[1-9]|0[1-9][0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])|(?:01|03|05|07|08|10|12)(?:\2(?:0[1-9]|[12][0-9]|3[01]))?|(?:04|06|09|11)(?:\2(?:0[1-9]|[12][0-9]|30))?|(?:02)(?:\2(?:0[1-9]|1[0-9]|2[0-8]))?|W(?:0[1-9]|[1-4][0-9]|5[0-3])(?:\2[1-7])?))?)$ |
Description |
Validate a date according to the ISO 8601 standard (no time part) considering long-short months to allow 31st day of month and leap years to allow 29th February. I took Ted Cambron's implementation, simplified and added support for leap years and long-short months. |
Matches |
1600-02-29 |
Non-Matches |
2011-02-29 |
Author |
Rating:
Robert Ševčík (Robajz)
|
Title |
Test
Details
Date validation US format
|
Expression |
^(([1][0-2])|([0]?[1-9]{1}))\/(([0-2]?\d{1})|([3][0,1]{1}))\/(([1]{1}[9]{1}[9]{1}\d{1})|([2-9]{1}\d{3}))$ |
Description |
MM/DD/YYYY
Year from 1990-9999
Thx to: http://regexlib.com/%28X%281%29%29/REDetails.aspx?regexp_id=60 |
Matches |
12/31/2012 | 12/0/2012 | 2/31/2012 |
Non-Matches |
19/28/2012 | 0/12/1999 | 5/25/1980 |
Author |
Rating:
Not yet rated.
Black Cloud
|
Title |
Test
Details
Date validation with leap year 2010 to 2099
|
Expression |
^((((((0?[1-9])|([1-2][0-9])|(3[0-1]))-(([jJ][aA][nN])|([mM][aA][rR])|([mM][aA][yY])|([jJ][uU][lL])|([aA][uU][gG])|([oO][cC][tT])|([dD][eE][cC])))|(((0?[1-9])|([1-2][0-9])|(30))-(([aA][pP][rR])|([jJ][uU][nN])|([sS][eE][pP])|([nN][oO][vV])))|(((0?[1-9])|(1[0-9])|(2[0-8]))-([fF][eE][bB])))-(20(([13579][01345789])|([2468][1235679]))))|(((((0?[1-9])|([1-2][0-9])|(3[0-1]))-(([jJ][aA][nN])|([mM][aA][rR])|([mM][aA][yY])|([jJ][uU][lL])|([aA][uU][gG])|([oO][cC][tT])|([dD][eE][cC])))|(((0?[1-9])|([1-2][0-9])|(30))-(([aA][pP][rR])|([jJ][uU][nN])|([sS][eE][pP])|([nN][oO][vV])))|(((0?[1-9])|(1[0-9])|(2[0-9]))-([fF][eE][bB])))-(20(([13579][26])|([2468][048])))))$ |
Description |
This expression can validate dates in the range of years 2010-2099 with accounting for leap year. Format of date dd-mmm-yyyy.
With a bit of tweaking, the year range can be expanded. Didn't do it myself as requirement was to validate future dates. |
Matches |
29-fEb-2012, 1-JaN-2013, 31-Dec-2099 |
Non-Matches |
29-feb-2013, 35-nov-2078, 25-dec-2100 |
Author |
Rating:
Not yet rated.
Moiz Tankiwala
|
Title |
Test
Details
Date Validation Expression
|
Expression |
^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}|(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/\d{2}|(0[1-9]|1[0-2])\-(0[1-9]|1\d|2\d|3[01])\-(19|20)\d{2}|(0[1-9]|1[0-2])\-(0[1-9]|1\d|2\d|3[01])\-\d{2}|([1-9]|1[0-2])\/([1-9]|1\d|2\d|3[01])\/(19|20)\d{2}|([1-9]|1[0-2])\/([1-9]|1\d|2\d|3[01])\/\d{2}|([1-9]|1[0-2])\-([1-9]|1\d|2\d|3[01])\-(19|20)\d{2}|([1-9]|1[0-2])\-([1-9]|1\d|2\d|3[01])\-\d{2}|(([0-9])|([0-2][0-9])|([3][0-1]))\-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\-\d{4}|(([0-9])|([0-2][0-9])|([3][0-1]))\-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\-\d{2}$ |
Description |
Date Validation Expression |
Matches |
m-d-yy m-d-yyyy mm-dd-yy mm-dd-yyyy m/d/yy m/d/yyyy mm/dd/yy mm/dd/yyyy dd-MMM-yyyy dd-MMM-yy |
Non-Matches |
d-m-yy d-m-yyyy dd-mm-yy dd-mm-yyyy d/m/yy d/m/yyyy dd/mm/yy dd/mm/yyyy MMM-dd-yyyy MMM-dd-yy |
Author |
Rating:
Not yet rated.
Hari Balaram R J
|
Displaying page
of
pages;
Items to