Problems with Filter?

Mark Wieder ahsoftware at sonic.net
Sat Mar 12 15:43:07 EST 2022


On 3/12/22 12:06, Rick Harrison via use-livecode wrote:
> Hi Mark,
> 
> matchText works fine.
> 
> That doesn’t explain why “filter” doesn’t work though.

Yes. It does. Filter won't give you a substring.

You can use filter to get the whole line of text, but you'll still have 
to dig out the substring if that's what you're after.

In your original code, change to
     put "*THIS*FIND*" into tTarget
     filter pText with tTarget into tFilteredTextResult
or
     put ".*THIS.*FIND.*" into tTarget
     filter pText with regex pattern tTarget into tFilteredTextResult

-- 
  Mark Wieder
  ahsoftware at gmail.com



More information about the use-livecode mailing list