[thelist] regex for date help [solved]

Tom Dell'Aringa pixelmech at yahoo.com
Wed Aug 31 15:09:59 CDT 2005



--- Tom Dell'Aringa <pixelmech at yahoo.com> wrote:
> /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/

My apologies - I had another code error and it wasn't the regex. I actually didn't want to allow a
dash/period either so I changed it to:

var datematch = /^\d{1,2}(\/)\d{1,2}\1\d{4}$/.test(stringDate);

Which works just fine.

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