[plug] re: replacing text in search

Jon Miller jlmiller at mmtnetworks.com.au
Sat Aug 2 13:10:10 WST 2003


Thanks for the info and fair enough comment.  I've always been told to use re: meaning regards/regarding.  Just goes to show how folks down under thinks vs folk from above.

Thanks

Jon L. Miller, MCNE, CNS
Director/Sr Systems Consultant
MMT Networks Pty Ltd
http://www.mmtnetworks.com.au

"I don't know the key to success, but the key to failure
 is trying to please everybody." -Bill Cosby



>>> devenish at guild.uwa.edu.au 12:32:17 PM 2/08/2003 >>>
In message <1059753223.2187.2957.camel at jlmpc>
on Fri, Aug 01, 2003 at 11:53:43PM +0800, 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.

There are two typical methods for such problems with regexes (this FAQ
applies in general -- it is nothing specific to vim):

1/ Make use of the escape character (the backslash). For example:

:s/\/sbin\/iptables/blah/g

2/ Redefine the pattern separation character (so that it's no longer the
slash). For example, use the @ character (an arbitrary choice):

:s@/sbin/iptables at blah@g

PS. It would make more sense to more people if you don't put "re:" in
the subject line of new e-mails (i.e. only use it for replies).







More information about the plug mailing list