01-26-2021, 11:54 PM
this works for your example
select the text below the #ret line then run
select the text below the #ret line then run
out
_s.getsel
str s ss
int i
ARRAY(str) result
if _s.len
,findrx(_s "goto(\s.+)" 0 8 s 1); s.rtrim()
,foreach ss _s
,,if(StrCompareEx(ss s 1)<>0)
,,,ss.replacerx("^\040.+$|\040\;\;.+" "")
,,if ss.len
,,,result[]=ss
,out result
else
,out "nothing is selected"
#ret
;lable1
run "notepad" ;;comment
;run "notepad" ;;comment2
_i+1
if _i=3
,ret
goto lable1
;coment3