I need help coming up with a regex to make sure the user enters a valid date The string will be in the format of mm/dd/yyyy
mm/dd/yyyy
Here is what I have come up
I have been working with this some time and the best regex I've came up with is the following:
\b(0)?(?(1)[1-9]|(3)?(?(2)[01]|[12][0-9]))\b|\b[1-9]\b
It will match the following numbers:
1 01 10 15 20 25 30 31
It does not match the following:
32 40 50 90