Use Regular Expressions to check date

Use regular expression to validate a date; added unit tests.