This is my take on it
str aa=
lable1
run "notepad" ;;comment
;run "notepad" ;;comment2
_i+1
if _i=3
ret
goto lable1
;coment3
ARRAY(str) result
str line
foreach line aa
str pattern= ";\D*."
line.replacerx(pattern "")
if(line.len)
result[]=line
str answer= result
answer.replacerx("$[]" "")
out answer
When im pasting its adding ;
so here is an image to show
str aa=
lable1
run "notepad" ;;comment
;run "notepad" ;;comment2
_i+1
if _i=3
ret
goto lable1
;coment3
ARRAY(str) result
str line
foreach line aa
str pattern= ";\D*."
line.replacerx(pattern "")
if(line.len)
result[]=line
str answer= result
answer.replacerx("$[]" "")
out answer
When im pasting its adding ;
so here is an image to show