search a date

Björnke von Gierke bvg at mac.com
Sat Aug 3 13:05:00 EDT 2002


on mouseUp
   local theDate -- this is neccesary
   repeat for each line theLine in textToSearch
     if matchtext(theLine, "([0-9][0-9]/[0-9][0-9]/[0-9][0-9])", 
theDate ) is true then
       put theDate & return after msg
     end if
   end repeat
end mouseUp

This returns one date per line if there are mor the one date per line, 
it will report the first one, even when in a line with other text... but 
it is not a function, so you will have to adjust it a little ;)

hope it solves your needs
Bjoernke

On Samstag, August 3, 2002, at 07:33 , Yves Coppé wrote:

> Hi,
>
> can someone help me to write a function.
>
> I have a text in a variable : textToSearch
>
> each line of the text contains text and numbers
> some lines of the text contains a date in the systemFormat
> (for me in French format : DD/MM/YY)
> I'd like to extract only the dates
>
> the function should return :
> 12/12/00
> 25/01/01
> 30/03/01
> 15/06/01...
>
> and this dates are extract from my text
>
> Note : where a line contains a date, this line contains only a date and 
> no ohter data
>
> Thanks.
> -- Greetings.
>
> Yves COPPE
>
> Email : 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