I need to validate date in string to the format of yyyy-MM-dd
using regular expressions.
now I can check whether the string matches that format or not by:
if value.matches("^[0-9]{4}-[0-9]{2}-[0-9]{2}") {
but it also accepts 2009-90-90
and that's invalid date.
So how can I add range in my regular e.g no more than 12
months in the date.
Thank you