On 3/12/22 08:43, Rick Harrison via use-livecode wrote:
Good Morning!

I’m trying to get filter to work with some text and so far no success at all.

Given large string:  abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz

I want the text between THIS and FIND which could be anything like ISLJFKKDKLS

It’s OK to include the THIS and FIND in my result.

I’m thinking I need a wildcard character like * to get the information.


So if I try:
put "THIS*FIND" into tTarget

put “abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz” into tLargeTextString

put tLargeTextString into pText

filter pText with regex tTarget into tFilteredTextResult

answer "tFilteredTextResult = " & tFilteredTextResult

One might think this would work, but it doesn’t, and I get nothing for 
tFilteredTextResult

Suggestions?

Try matchtext rather than filter:

local tTextt, tFound?
put matchtext(tLargeTextString, ".*THIS(.*)FIND.*", tText) into tFound?

--
 Mark Wieder
 ahsoftw...@gmail.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to