Hi Shery,

Your regex alternative works fine. I am not too familiar yet with regex, but 
could you please show how this line would change if I wanted all lines 
containing trigger2 AND trigger4 to be removed ?

Thanks



--- In [email protected], "Sheri" <sheri...@...> wrote:
>
> --- In [email protected], "dleidinger" <dleidinger@> wrote:
> >
> > Hi,
> >  
> > > for (local i=0; i<v.length; )  //must recompute v.length, no i++
> > > if (find(v[i],"Trigger2") > -1) do
> > > v.delete(i)  // shifts all elements down, so  look at new v[i] next
> > > else
> > > i++
> > > endif
> > > endfor
> > 
> > i like trying to reduce code to a minimum, if the result still remains 
> > somehow understandable. 
> > 
> > for(local i=v.length-1; i>=0; i--) 
> >    if(find(v[i],"Trigger2") > -1)
> >       v.delete(i)
> > endfor
> > 
> > p.s.
> > Could this also be done with regex ?
> > 
> > Best regards Detlef
> >
> 
> here trigger2 is case insensitive, since I think it is insensitive with find 
> as was being used:
> 
> clip.set(regex.pcrereplace(?"(?im).+?trigger2.+(\R|\z)",clip.get,""))
> messagebox("OK", clip.get)
> 
> Regards,
> Sheri
>


Reply via email to