[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Vi search and replace



Phil wrote:
Hello,

I am trying to do a search and replace in vi but I need to search and replace on "/T"

so how do I escape the /?

%s/"/T"/T/g obvisouly does not work....

how do I specify a / in the vi search string?


For example:

:1,$s!/!!g

is the same as

:1,$s/\//g

removes all / chars in all lines (you can use another search pattern delimiter instead of "/" - this is "!" here). In this way, escaping is not needed.

--
Joachim Backes <joachim backes rhrk uni-kl de>
University of Kaiserslautern,Computer Center [RHRK],
Systems and Operations, High Performance Computing,
D-67653 Kaiserslautern, PO Box 3049, Germany
--------------------------------------------------
Phone: +49-631-205-2438, FAX: +49-631-205-3056
http://hlrwm.rhrk.uni-kl.de/home/staff/backes.html

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]