Title |
Test
Find
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
|
Source |
|
Your Rating |
|
Title: can you provide the date expression to validate future date in <255 char not allow past date
Name: Anita
Date: 12/1/2021 11:06:24 PM
Comment:
can you provide the date expression to validate future date in <255 char
not allow past date
Title: can you provide the date expression to validate future date in <255 char not allow past date
Name: Anita
Date: 12/1/2021 11:03:48 PM
Comment:
can you provide the date expression to validate future date in <255 char
not allow past date
Title: can you provide the date expression to validate future date in <255 char not allow past date
Name: Anita
Date: 12/1/2021 11:03:26 PM
Comment:
can you provide the date expression to validate future date in <255 char
not allow past date