From owner-freebsd-questions Tue Nov 24 17:44:24 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA09204 for freebsd-questions-outgoing; Tue, 24 Nov 1998 17:44:24 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from kitsune.swcp.com (swcp.com [198.59.115.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA09191 for ; Tue, 24 Nov 1998 17:44:12 -0800 (PST) (envelope-from msommer@argotsoft.com) Received: from argotsoft.com (argotsoft.com [198.59.115.127]) by kitsune.swcp.com (8.8.8/1.2.3) with ESMTP id SAA19050 for ; Tue, 24 Nov 1998 18:44:03 -0700 (MST) Received: from rincon (rincon.argotsoft.com [192.168.3.102]) by argotsoft.com (8.8.8/8.8.7) with SMTP id SAA03320 for ; Tue, 24 Nov 1998 18:43:11 -0700 (MST) (envelope-from msommer@argotsoft.com) Message-Id: <3.0.3.32.19981124184307.00973b40@mail> X-Sender: msommer@mail X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.3 (32) Date: Tue, 24 Nov 1998 18:43:07 -0700 To: questions@FreeBSD.ORG From: "Mark J. Sommer" Subject: Re: "vi" problem with search & replace (vi do not accept "/"). Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At 03:26 PM 11/24/98 -0800, you wrote: >>Date: Tue, 24 Nov 1998 18:23:45 -0500 >>From: Malartre > >>This is not FreeBSD specific, but I guess someone could give me the >>trick: >>I want to "search & replace" the sentence "" with >>"<>". > >>:%s//<>/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. Better yet, since typing \/ is a pain, just use :%s::<>:g The substitute command will use the first char as the delimeter. ~Mark ---------------------- msommer@argotsoft.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message