Problem with regular expression for checking date


I checking the validation of date here as


It’s working fine, But when I give FEB-30 It’s accepting because in the
above expression it’s not restricted. So How do I impose the condition
in such a way that It would block for FEB-30 as well?

Wouldn’t it be more effective to use Date.parse to check for valid
dates? Regular Expressions for date checking are unreliable at best
since they’re more about patterns than actual values.

On Fri, Oct 18, 2013 at 4:06 PM, Raja gopalan [email protected]

Posted via

Don’t forget about June 31, April 31, etc.
Also, Feb. 29, 2015, etc.


Hi Joel P.
ohhhhhhhhhhh yes, I haven’t thought of that. Thank you very much.

hi Harry
yes sure.