Regex for a date or a string
-
My regex to validate my dates is:
/^\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])$/This required a date formatted like this: 2999-12-31 in a field date
I would like to add the option of entering 9999-12-31 (meaning: I don’t have this date)
I tried but have been unable to find the exact regex to do that.
What should it be ?Thanks
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Regex for a date or a string’ is closed to new replies.