RegEx question
Ken Ray
kray at sonsothunder.com
Sat Apr 10 12:31:51 EDT 2004
Yves,
As Brian pointed out, you just need to copy what you are doing with the
month for the day... that is, take what Dar suggested:
(0?[1-9]|[12][0-9]|3[01])
and just take out the ?:
(0[1-9]|[12][0-9]|3[01])
This will enforce the need for leading zeroes.
Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of
> Yves COPPE
> Sent: Saturday, April 10, 2004 7:12 AM
> To: How to use Revolution
> Subject: Re: RegEx question
>
>
> Hi Dar
>
>
>
> > Maybe this will work:
> >
> > function CheckDate pDateToCheck
> > return
> >
> matchText(pDateToCheck,"\A(0?[1-9]|[12][0-9]|3[01])/(0[1-9]|1[0-2])/
> > ([0-9][0-9][0-9][0-9])\z")
> > end CheckDate
> >
> > It is not consistent yet as to whether the leading zero is
> optional.
> > It is optional for the day of the month, but required for the month.
> >
>
>
> i'm almost on the good regEx
> but now I'd like that the day MUST be two chars and not an optional
>
> so :
>
> 05/04/2004 returns true
> and
> 5/04/2004 should return false (at this moment, it returns true)
>
> Can you give me one more hint ??
>
> Amicalement.
>
> Yves COPPE
> yvescoppe at skynet.be
>
> _______________________________________________
> 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