[plug] re: replacing text in search

Bernd Felsche bernie at innovative.iinet.net.au
Sat Aug 2 22:16:18 WST 2003


On Sat, Aug 02, 2003 at 12:23:23PM +0800, Steve Baker wrote:
> Jon Miller wrote:

> >In vim how do I do a search and replace for the following
> >/sbin/iptables?  I've tried %s//sbin/iptables/g but this does not work. 
> >I'm need to include the / character in the search.
> >
> >Thanks
> 
> Put a \ before the / to escape it in the search string, ie: 
> %s/\/sbin\/iptables/otherstring/g.
> 
> Some versions of vi (don't know if this includes vim) also allow 

All version of vi in the wild do that. Including most free ones
including vim.

> different characters instead of / as a delimeter, so try 
> %s:/sbin/iptables:otherstring:g as well.

-- 
/"\ Bernd Felsche - Innovative Reckoning, Perth, Western Australia
\ /  ASCII ribbon campaign | I'm a .signature virus!
 X   against HTML mail     | Copy me into your ~/.signature
/ \  and postings          | to help me spread!



More information about the plug mailing list