Search question
Ken Corey
ken at kencorey.com
Mon Jan 30 12:45:28 EST 2012
How about this:
--------------8<-----------------
repeat for each line myLine in myList
if matchText(myLine, \
"([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)$", \
myVar1, myVar2, myVar3, myVar4) then
if myVar1="foo" and myVar3="bar" and myVar4="baz" then
-- take some action here
end if
end if
end repeat
--------------8<-----------------
I'm typing this from memory, and I'm not sure about that repeat
statement. I always seem to need to look it up.
This assumes, of course, that the fields cannot have tab characters in them.
-Ken
On 30/01/2012 17:35, Marty Knapp wrote:
> Let's say I have a tab delimited list with 4 items and I want to find a
> match to my search string, except I don't care what item 2 is - it could
> be a number, a word or be empty, but I want to find the occurrences
> where items 1, 3 & 4 match. What's the fastest way to do that?
More information about the use-livecode
mailing list