I am looking for an elegant solution (within a vim script) to iterate over all matches the regular expression in the buffer. It will be something like
fu! DoSpecialThingsWithMatchedLines()
for matched_line_no in (GetMatchedPositions("/foo\\>.*\\<bar"))
let line = getline(matched_line_no)
call DoItPlease(line)
end for
endfu
Is there something similar? I'm not necessarily looking for a complete solution, any pointer directing me in the right direction will do.
Thanks / Renee
source
share