Re: Difficult find and replace problem (for me)
Posted: Tue Jun 16, 2020 3:42 pm
Dunno about REGEX, but why bother:
- -
I couldn't understand any of your code, so I wrote my own.
5 minutes. 
- -
I couldn't understand any of your code, so I wrote my own.
Code: Select all
on mouseUp
put 1 into LYNE
put fld "fURTEXT" into URTEXT
repeat until char 1 of URTEXT is empty
if char 1 of URTEXT is "[" then
put "START" into SEMAPHORE
else
if char 1 of URTEXT is "]" then
put "FINISH" into SEMAPHORE
put "]" after line LYNE of fld "fXTRACT"
add 1 to LYNE
end if
end if
if SEMAPHORE contains "START" then
put char 1 of URTEXT after line LYNE of fld "fXTRACT"
end if
delete char 1 of URTEXT
end repeat
end mouseUp