Re: Easier way to do this? Find variables in text
Posted: Mon May 06, 2019 12:27 pm
Here is a minimal stack that does the job using regex
Questions and answers about the LiveCode platform.
https://forums.livecode.com/
Code: Select all
on mouseup
local tOriginal, tResult
put fld "Original" into tOriginal
repeat forever
if not matchChunk(tOriginal, "@{(.+?)}", tStart, tEnd) then exit repeat
put char tStart to tEnd of tOriginal & cr after tResult
delete char 1 to tEnd of tOriginal
end repeat
delete last char of tResult
put tResult into fld "Result"
end mouseup