RegEx for a date

yves COPPE yvescoppe at
Sat Dec 21 03:45:01 EST 2002

>A couple of things... first, you are missing the key function call to
>"matchText" in your regex call; secondly, you don't need to provide
>additional variables for theDay, theMonth and theYear unless you are
>planning on doing something with them later on (i.e. you don't need them
>just for verification); and finally, you are exiting the repeat loop as soon
>as you find a good date (I'm not sure if this is what you want). Your
>original post said you just wanted to check to see if a line of data is in
>the right format, so I removed the repeat loop (you can put it back in if
>you're checking a list of dates).
>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

Thank you very much for the lesson and the solution...!!!


Email : yvescoppe at

More information about the Use-livecode mailing list