RegEx for a date

Rob Cozens rcozens at
Sun Dec 22 11:23:48 EST 2002

>Here's what worked for me (verification on one line only):
>function CheckDate pDateToCheck
>   if
>[0-9][0-9])") is true then
>     return pDateToCheck
>   else
>     return "Bad date"
>   end if
>end CheckDate

Ken, Yeves, et al:

I'm not a regEx user, but doesn't the above accept as valid dates input like:

* 30/02/2002   (Feb 30)
* 31/04/2002   (April 31)
* 29/02/2002   (Feb 29 on non leap years)


The Serendipity Library validDate function will correctly validate 
any date as correct or incorrect based on the system date format: 

Rob Cozens
CCW, Serendipity Software Company

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)

More information about the Use-livecode mailing list