Simple Date Format Verification:
^ ([1-2] \ D {3}) [\/| \-] (0? [1-9] | 10 | 11 | 12) [\/| \-] ([1-2]? [0-9] | 0 [1-9] | 30 | 31) $
The following regular expression not only matches the date format, but also imposes strict requirements on the date logic. It determines the 31 days of a large month, 30 days of a small month, February 28 days, and February 29 days of a leap year.
(^ (1 [8-9] \ D {2}) | ([2-9] \ D {3 }))([-\/\. _]) (10 | 12 | 0? [13578]) ([-\/\. _]) (3 [01] | [12] [0-9] | 0? [1-9]) $) | (^ (1 [8-9] \ D {2}) | ([2-9] \ D {3 })) ([-\/\. _]) (11 | 0? [469]) ([-\/\. _]) (30 | [12] [0-9] | 0? [1-9]) $) | (^ (1 [8-9] \ D {2}) | ([2-9] \ D {3 })) ([-\/\. _]) (0? 2) ([-\/\. _]) (2 [0-8] | 1 [0-9] | 0? [1-9]) $) | (^ ([2468] [048] 00) ([-\/\. _]) (0? 2 )([-\/\. _]) (29) $) | (^ ([3579] [26] 00 )([-\/\. _]) (0? 2 )([-\/\. _]) (29) $) | (^ ([1] [89] [0] [48]) ([-\/\. _]) (0? 2 )([-\/\. _]) (29) $) | (^ ([2-9] [0-9] [0] [48]) ([-\/\. _]) (0? 2 )([-\/\. _]) (29) $) | (^ ([1] [89] [2468] [048]) ([-\/\. _]) (0? 2 )([-\/\. _]) (29) $) | (^ ([2-9] [0-9] [2468] [048]) ([-\/\. _]) (0? 2 )([-\/\. _]) (29) $) | (^ ([1] [89] [13579] [26]) ([-\/\. _]) (0? 2 )([-\/\. _]) (29) $) | (^ ([2-9] [0-9] [13579] [26]) ([-\/\. _]) (0? 2) ([-\/\. _]) (29) $ ))