Date in YYYY-MM-DD format
Use regex ^\d\d\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$ to test.
^\d\d\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$
Thanks to Vinod at https://stackoverflow.com/a/22061879 for the regex.
Date in YYYY-MM-DD format
Use regex
^\d\d\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$
to test.Thanks to Vinod at https://stackoverflow.com/a/22061879 for the regex.