RegEx for a date

Ken Ray kray at sonsothunder.com
Sun Dec 22 17:47:01 EST 2002


You're of course right, Rob... I was not focusing on the validity of the
dates as much as the validity of the regex itself. Thanks for the link...

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/

----- Original Message -----
From: "Rob Cozens" <rcozens at pon.net>
To: <use-revolution at lists.runrev.com>
Sent: Sunday, December 22, 2002 9:51 AM
Subject: Re: RegEx for a date


> >Here's what worked for me (verification on one line only):
> >
> >function CheckDate pDateToCheck
> >   if
>
>matchText(pDateToCheck,"(0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[0-2])/([0-9][0-9
]
> >[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)
>
> etc.?
>
> The Serendipity Library validDate function will correctly validate
> any date as correct or incorrect based on the system date format:
> <http://www.oenolog.com/ftp/serendipity_downloader.htm>.
> --
>
> Rob Cozens
> CCW, Serendipity Software Company
> http://www.oenolog.com/who.htm
>
> "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)
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the Use-livecode mailing list