I know how to output lines of matched strings (result from find command) by simply using editor:MarkerNext()
:
function print_marked_lines()
local ml = 0
local lines = {}
while true do
ml = editor:MarkerNext(ml, 2)
if (ml == -1) then break end
table.insert(lines, (editor:GetLine(ml)))
ml = ml + 1
end
local text = table.concat(lines)
print(text)
end
What I don't know is how to output only matched strings (not whole line as with posted snippet). I assume there is solution as matched strings are highlighted and must have some property which would allow extracting them, but I guess Scintilla knowledge is needed as I couldn't find any reference in provided SciTE bindings.
Example screenshot for find/match all regex pattern "I \w+":
I want to output (print to output pane) all highlighted string parts