tags:

views:

34

answers:

2

Hello, is there a good regex expression that would be able to compare two dates like 3/27/2010 to 3/8/2010 to tell if the first date is greater then the second date?

I'd like to compare using javascript

+3  A: 
if (new Date("3/27/2010") < new Date("3/8/2010")) {
   alert("something's wrong.");
}
KennyTM
A: 

It is almost impossible, and completely insane, to do this with a regular expression.

Instead, use Javascript's Date object:

if (new Date(str1) > new Date(str2))
SLaks