I can use
:5,12s/foo/bar/g
to search for foo and replace it by bar between lines 5 and 12. How can I do that only
foo
bar
You could always add a c to the end. This will ask for confirmation for each and every match.
c
:5,12s/foo/bar/gc