Use the Last Search Term for a Substitution in Vim
It is quite usual to first search for something in vim just to use it in a substitution afterwards. To do so just leave the substitution pattern of the substitution command empty. This way it is possible to build complex regular expressions interactively with the help of the search function and later use it in a substitution without having to enter the regex again.
The following example shows a search for foo in the current line and replaces the first match with bar with the second command. See help :s and help / in vim for more information on search and subtitute.
/foo :s//bar