you can test this expression:
^\d{4}[\-\/\s]?((((0[13578])|(1[02]))[\-\/\s]?(([0-2][0-9])|(3[01])))|(((0[469])|(11))[\-\/\s]?(([0-2][0-9])|(30)))|(02[\-\/\s]?[0-2][0-9]))$
Description:
validates a yyyy-mm-dd, yyyy mm dd, or yyyy/mm/dd date
makes sure day is within valid range for the month - does NOT validate Feb. 29 on a leap year, only that Feb. Can have 29 days
Matches (tested) : 0001-12-31 | 9999 09 30 | 2002/03/03