Pattern Matching in Livecode
capellan2000 at gmail.com
Wed Nov 9 15:19:20 EST 2016
Your clever idea of reverting search terms works great too.
Many Thanks for answering my request! :D
I have posted a new stack and a screenshot
at the forum thread:
put fld id 1008 into WL -- 12 words
put fld id 1014 into SC -- 1080 combinations
repeat for each line Q in SC
if lineoffset(word 1 of Q,WL) <> 0 and \
lineoffset(word 2 of Q,WL) <> 0 and \
lineoffset(word 3 of Q,WL) <> 0
put word 1 to 3 of Q & return after tCombinations
if the number of words of tCombinations > 2
-- delete last char of tCombinations -- a CR character
sort numeric descending tCombinations
put word 1 to -1 of tCombinations into fld id 1025
put "No matching set found" into fld id 1025
Still, I am curious to learn if regex and arrays operations
could produce the same results but faster.
Have a nice week!
More information about the Use-livecode