can I filter lines with a list of alternative OR strings?

David V Glasgow dvglasgow at gmail.com
Mon Mar 21 09:13:59 EDT 2022


Thanks, Dick!  I’ll play with that and see how I get on.  The filter is in a loop which mostly uses simple strings, so presumably I would need to separate any regex filters into a separate loop using 'with regex'.

I have also learned that this is called “alternation”.  Didn’t know that, so now I can investigate further! 

thanks again

David G

> On 6 Mar 2022, at 11:12 pm, Dick Kriesel via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> 
>> On Mar 3, 2022, at 2:30 AM, David V Glasgow via use-livecode <use-livecode at lists.runrev.com> wrote:
>> 
>> I can filter text using a single term plus a numerical range s eg:
>> *re 1[0-5]*
>> matching a text stem “re “ followed by any one of 10, 11, 12, 13, 14 or 15 
>> 
>> But is there a form where the alternatives are also text?  eg something like:
>> 
>> *big [“dog”, “cat”, “fish”]*
> 
> Hi, David.
> 
> regex supports alternation, so if you put "big dog|big fish" into tTarget then you can
> <code>
> filter pText with regex tTarget
> </code>
> 
> Does that work for you?
> 
> — Dick
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list