Basic debugging checklist, Tip #9: Demystify regular expressions by installing and using the CPAN module
YAPE::Regex::Explain
The regular expression:
(?-imsx:[1-31]-[1-12]-[1-99])
matches as follows:
NODE EXPLANATION
----------------------------------------------------------------------
(?-imsx: group, but do not capture (case-sensitive)
(with ^ and $ matching normally) (with . not
matching \n) (matching whitespace and #
normally):
----------------------------------------------------------------------
[1-31] any character of: '1' to '3', '1'
----------------------------------------------------------------------
- '-'
----------------------------------------------------------------------
[1-12] any character of: '1' to '1', '2'
----------------------------------------------------------------------
- '-'
----------------------------------------------------------------------
[1-99] any character of: '1' to '9', '9'
----------------------------------------------------------------------
) end of grouping
----------------------------------------------------------------------
BTW, "validate valid date" has a nice ring to it :)