Thanks all for the pointers, and I agree with Mark that I failed to define the problem clearly! So here it is. Please look at the attached screenshot. The button "Clean text" has the following script:
Code: Select all
put fld "text" into tTheText
repeat with i = 1 to the number of lines of field "find"
put replacetext (tTheText, line i of fld "find", line i of fld "replace") into tTheText
end repeat
put tTheText into field "final text"
So it is a kind of user friendly Perl script. Ideally I want to put standard PCRE text in the replace box, but I am happy to put LiveCode constants like "return" if no other way. (Actually, putting return in "replace" is not working with or without quotes. I am sure that is a newbie question!)
This is not the primary goal, but it would be nice to click a button when the script is working, and generate a Perl or Python script.
Thanks for the help so far and any further ideas appreciated.