Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Nov 1998 07:18:20 -0600 (CST)
From:      "Paul T. Root" <proot@horton.iaces.com>
To:        malartre@aei.ca (Malartre)
Cc:        questions@FreeBSD.ORG
Subject:   Re: "vi" problem with search & replace (vi do not accept "/").
Message-ID:  <199811251318.HAA10956@horton.iaces.com>
In-Reply-To: <365B4001.4EFA71EB@aei.ca> from Malartre at "Nov 24, 98 06:23:45 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Put a \ in front of every /

:%s/<\/TT><\/B><\/FONT>/<<\/COMMAND>>/g

Or, I think you can substitute a different character
for the / in the vi command. 

:%s!</TT></B></FONT>!<</COMMAND>>!g

In a previous message, Malartre said:
> This is not FreeBSD specific, but I guess someone could give me the
> trick:
> I want to "search & replace" the sentence "</TT></B></FONT>" with
> "<</COMMAND>>".
> 
> :%s/</TT></B></FONT>/<</COMMAND>>/g
> 
> But that give me an error (has I expected, because of the "/" in those
> HTML tags.
> 
> Usage: [line [,line]] s [[/;]RE[/;]repl[/;] [cgr] [count] [#lp]].
> 
> Well, I don't know how to type a "/" without interfering with vi's /.
> 
> Thank you
> -- 
> [Malartre][malartre@aei.ca][http://www.lowrent.org/freebsd/malartre/]
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 


-- 
The best cure for insomnia is to get a  lot  of sleep.
                -- W. C. Fields

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811251318.HAA10956>