Define the regular expression date, which only matches dates written as ten-character strings YYYY-MM-DD.
For example, 2016-04-12
represents April 12 2016
, whereas 2016-04-31
is not a valid date.
So far I have this:
val date = """([0-9]{4}-[0-9]{2}-[0-9]{2})"`"".r`
Right it, the 'days' section accepts numbers all the way past 31. So you can have 2016-01-34
I believe I know how to fix that, however my issue is fiuring how to match each month. Meaning, how do I know January is 31 days, feb is 29 (leap year included), etc..