Reputation: 20015
For example, I want to delete untill the next </p>
tag. Doing
d/</p>
Won't work since </p>
is treated as a regular expression. Can I specify a plain text search pattern somehow?
Upvotes: 5
Views: 1067
Reputation: 172570
There are two things that need to be changed for a literal search:
/
) must be escaped with a backslash (d/<\/p>
). If this were a pattern in a :substitute
command, you could have also used a different delimiter (:s#</p>##
), but for the /
search command, you have to escape it.\V
; then, only the backslash itself needs escaping. Your example pattern doesn't suffer from this, but it is relevant for characters like .
and *
.Upvotes: 9
Reputation: 74
escape the slash with a backslash: d/<\/p>
, although I am not sure if this will work, depending upon what the format of your file is. You might have to do something more of the form :.,/<\/p>/d
.
Upvotes: 2