\%V atom in Vim restricts a pattern so that it matches only inside the visual selection.
So, your command for searching and replacing only in the visual selection can be
In addition, you can use marks for the beginning and end of the visual selection as the
start,end range for the
'< start line
`< start character
'> end line
`> end character