Reg Ex for date validation

Please give me some sample code that does validation for a date (mm-dd-yyyy) using reg ex.

Who is Participating?
sjklein42Connect With a Mentor Commented:
This is what can be done with regex.  However this does not prevent the 30th of February, for example.

dshrenikAuthor Commented:
Another one:
^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.