I did things another way:I want to replace all text within in parentheses (including the parentheses) with a single space. I have tried assembling the matchExpression in advance and in line, and also escaping the parentheses just in case they are reserved in regex. Or do I need to enclose the matchExpression in something other than or in addition to, quotes?
Code: Select all
on mouseUp
put empty into fld "f2"
put fld "fff" into FLUFFY
put 0 into CHEK
repeat until FLUFFY is empty
put char 1 of FLUFFY into FUR
delete char 1 of FLUFFY
switch FUR
case "("
put 1 into CHEK
break
case ")"
put 0 into CHEK
break
default
if CHEK < 1 then
put FUR after fld "f2"
else
--- do nix
end if
end switch
end repeat
end mouseUp