Filter and regex

MisterX b.xavier at internet.lu
Fri Aug 20 13:54:37 EDT 2004


set itemdelimiter to "/" -- or the french liberty item delimiter ;)
put "1/5/2004" into adate
-- find first monday
repeat while word 1 of thisdate is not "monday" --(or sunday
  put adate into thisdate
  add 1 to item 1 of adate -- assume french date
  convert thisdate to the long date
end repeat
-- end of find first monday...
get item 2 of adate
-- we found our day, let's calculate the week
add (myweeknumber-1) * 7 to it
put it into item 1 of adate -- this is the first day of any week.

--now you can replace
.*(0*[myday])/(0*[mymonth])/.*

-- You'll have to find the right syntax that works with RR
   i feel better when I dont mess with grep's nasty syntax
-- I put 0* in the grep code in case there is or not a 0
   before a day/month less than 10.
-- put in the last "/" in the grep but not the year unless 
   you need to check the year. This way you're sure you have 
   a date and not force the engine to search for more than 
   what's required.

bon weekend!
Xa

> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com]On Behalf Of Ludovic
> Thebault
> Sent: Friday, August 20, 2004 19:16
> To: How to use Revolution
> Subject: Re: Filter and regex
> 
> 
> On Fri, 20 Aug 2004 09:58:21 -0700, Mark Wieder wrote:
> > Well, if that's what you really want, then this does the trick:
> > 
> > 0[1-7]/05/*
> 
> Thanks, but it's more difficult. I'm on french system, also the date 
> format is DD/MM/YY.
> I want to found for example all datas of the first week of a month, or 
> the second week, the third week..
> 
> For the first week, your script work fine but for the rest.. i've tried 
> (to find datas from 8 may to 14 may)
> ((0[8-9])|(1[0-4]))/05/* but it doesn't work. 
> 
> PS : This regex works with BBedit (without *).
> 
> Ludovic
> _______________________________________________
> 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