Hi,
I have a container that I want to filter based upon a Global Variable.
The container has multiple lines of text with each line containing 4 words (TAB Del)
I want to be able to filter the container down to only the lines which match their 4th word to the global variable.
I am currently trying the filter but because the entire line doesn't match the variable it obviously doesn't work.
anyone got some ideas?
Filter
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Filter
Hi Nakia,
Here's a simple example:
Maybe you will want to replace the last line with
and you could also use ASCII values to allow for diacritics:
"[a-zA-Z0-9" & numToChar(142) & "]+[][a-z...." etc
Kind regards,
Mark
Here's a simple example:
Code: Select all
on mouseUp
put "x" into myVar
put "a b c x" & cr & "e f g x" & cr & "x i j y" into myList
put cr after myList
put replacetext(myList,"[a-z]+[ ][a-z]+[ ][a-z]+[ ]x"&cr,"")
end mouseUp
Code: Select all
put replacetext(myList,"[a-zA-Z0-9]+[ ][a-zA-Z0-9]+[ ][a-zA-Z0-9]+[ ]x"&cr,"")
"[a-zA-Z0-9" & numToChar(142) & "]+[][a-z...." etc
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Filter
Thanks Mark,
What i ended up doing what using the wild card on the front of the Search Pattern.
This will work for me because the first 3 word of every line wont ever contain the 4th word.
Looking at your solution however yours seems a better way.
What i ended up doing what using the wild card on the front of the Search Pattern.
This will work for me because the first 3 word of every line wont ever contain the 4th word.
Looking at your solution however yours seems a better way.