During the search operation,You need only those string to search and replace which is exactly the same string that you entered for search.
There are some relative advance command for that.You have to just put some advance options.One of the case sensitive matching example is given below -
Code:
:%s/\<word1\>/word2/gc
:%s/word1/word2/gci
:%s/word1/word2/gcI
The first statement will change only whole words which is exactly matching 'word1' to 'word2' and then would ask you for confirmation.the second will change each 'word1' (case insensitive) to 'word2' with confirmation where as the third statement will do the same as second.
Bookmarks