[thelist] regex for date help

Tom Dell'Aringa pixelmech at yahoo.com
Wed Aug 31 14:54:10 CDT 2005


Hi folks,

I need a regex for a date to be formatted as

mm/dd/yyyy

I have the following regex:

/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/

It seems to not quite work - it denies stuff that is wrong, but does not allow the right one
either...can anyone point out the mistake?

Thanks

Tom


http://www.pixelmech.com/

A man spoke frantically into the phone: "My wife is pregnant and her contractions are only two minutes apart"! "Is this her first child?" the doctor asked. "No, you idiot!" the man shouted. "This is her husband!"

Q: What do you call a muddy chicken who crossed the road two times?
A: A dirty double crosser...



More information about the thelist mailing list