Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Nov 1998 15:26:49 -0800 (PST)
From:      David Wolfskill <dhw@whistle.com>
To:        malartre@aei.ca, questions@FreeBSD.ORG
Subject:   Re: "vi" problem with search & replace (vi do not accept "/").
Message-ID:  <199811242326.PAA10376@pau-amma.whistle.com>
In-Reply-To: <365B4001.4EFA71EB@aei.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
>Date: Tue, 24 Nov 1998 18:23:45 -0500
>From: Malartre <malartre@aei.ca>

>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.

You need to "escape" the /:

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

>Well, I don't know how to type a "/" without interfering with vi's /.

It is common (in UNIX) to use \ as an "escape" mechanism.

david
-- 
David Wolfskill		UNIX System Administrator
dhw@whistle.com		voice: (650) 577-7158	pager: (650) 371-4621

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?199811242326.PAA10376>