ValidationExpression for dd-MMM-yyyy including leap years

Hi I have the following below. Its just a sample. I want the validatior to alert when 30-Feb entered and also alert when 29-Feb entered when not a leap year.

This question under the accepted solution has it for the format  ddmmyyyy.
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_22806356.html?sfQueryTermInfo=1+leap+valid+year


Could anyone help?
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><img id="btn" src="Images/calendar.png" />
    <cc1:CalendarExtender PopupButtonID="btn" Format="ddMMyyyy" TargetControlID="TextBox1" ID="cal" runat="server"></cc1:CalendarExtender>
    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
        ControlToValidate="TextBox1" ErrorMessage="Not a valid date" 
        ValidationExpression="">
    </asp:RegularExpressionValidator>

Open in new window

caoimhincryanAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gyanendra SinghArchitectCommented:
use this

 ^((((0?[1-9]|[12]\d|3[01])[\.\-\/](0?[13578]|1[02])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\.\-\/](0?[13456789]|1[012])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\.\-\/]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)|00)))|(((0[1-9]|[12]\d|3[01])(0[13578]|1[02])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|[12]\d|30)(0[13456789]|1[012])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|1\d|2[0-8])02((1[6-9]|[2-9]\d)?\d{2}))|(2902((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00))))$

This patteren accepts '.' '-' and '/'
0
caoimhincryanAuthor Commented:
That works good but would you have an expression that allows it for dd-MMM-yyyy i.e- 13-Nov-2008. I have the wrong format in my code snippet above. Sorry about that.
0
Gyanendra SinghArchitectCommented:
ohh you want word ... let me try
0
caoimhincryanAuthor Commented:
Any luck BondinASP?
0
caoimhincryanAuthor Commented:
^((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})$

I think i may have solved it. This has the format dd-MMM-yyyy and also checks for leap years and months that don't have 31 days.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.