Simple example.
Code: Select all
local t="abcdefg"
on mouseUp
repeat for each char c in t
put cr & c &"[" after s
end repeat
put char 2 to -1 of s into myInput
-- try also patterns other than "a["
if the shiftkey is down then
filter myInput without "a[" --> returns myInput (the full string)
else filter myInput with "a[" --> returns empty
put myInput into fld "OUT"
end mouseUp
= filter <inputVar> with <pattern> returns always empty, no matter the pattern
= filter <inputVar> without <pattern> returns always the full <inputVar>, no matter the pattern
Never filter filenames if any of the paths contains a left square bracket ...
Tested to be faulty with LC 6.7.11/7.1.4/8.1.0-dp1.
Didn't test other filtering/matching methods.