I'm stumped. I'm trying to do date validation with regular expressions. So far, I haven't found any examples that are complete.
I can articulate the rules, I just can't come up with the correct regular expression. I'm trying to validate against the mm/dd format.
mm can be 0-12, with or without a leading zero ( ^0?[1-9]) | 1[0-2] )
but, depending on what the month is, we want to make sure that we only validate actual date numbers (January, March, May, July, August, October, and December = 31; February = 29; April, June, September, and November = 30).
So I think I have to have three all-encompassing OR statements in my RegEx.
I've been trying to come up with a string that will do this (the days also could have a leading zero or not), and have the RegEx validate ONLY actual dates (4/31, 2/30, 6/00, 14/02 would not validate, but 1/1, 1/11, 1/01, 5/15 would).
Has anyone done this? Surely they have. Surely I don't have to reinvent the wheel.
(And for all you Airplane fans..."Don't call me Shirley.")
Thanks in advance!