[I added line breaks so the page is not billion characters wide - Eric] [ January 25, 2008: Message edited by: Eric Pascarello ]
Joined: Nov 08, 2001
Persoanlly I would not try to figure out the 30/31/leap year stuff in the regular expression. I would let a second check figure it out. If you HAVE to do it in a regular expression it will be yucky. I will code the whole thing here for fun durning my lunch.
A.M or P.M [I left the . there, I do not know anyone that does that!]
From here I will build a function that tests for a valid date. It will test to make sure that someone does not set 31 days in the wrong month.
With that function, we can combine it with our regular expression and build another function that can do the total valid date/string format
So now we have the function. How do we use this thing?
I just copied all of the code I wrote here over to a test page to see if it works and I got true, false, false, false so it is looking good.
If you need to have the regular expression validate everything without a second check, it will be hard, but if we break it up into parts like I did above it maybe a little easier. Need to figure out patterns for 29/30/31 and for leap years.
Eric [ January 25, 2008: Message edited by: Eric Pascarello ]