Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to search </string> in vim?

Tags:

linux

vim

vi

ubuntu

I want to search in vim,

/</string>

but it didn't work, how to do can exactly match "</string>"?

like image 554
Victor S Avatar asked Jul 31 '13 06:07

Victor S


People also ask

How do I search for A string in Vim?

To find a character string, type / followed by the string you want to search for, and then press Return. vi positions the cursor at the next occurrence of the string. For example, to find the string “meta,” type /meta followed by Return. Type n to go to the next occurrence of the string.

Is there A search function in Vim?

Basic SearchVim allows you to quickly find text using the / (forward slash) and ? (question mark) commands. It is important to note that the search command looks for the pattern as a string, not a whole word.

How do you do A search and replace string in Vim?

The simplest way to perform a search and replace in Vim editor is using the slash and dot method. We can use the slash to search for a word, and then use the dot to replace it. This will highlight the first occurrence of the word “article”, and we can press the Enter key to jump to it.

How do I find special characters in Vim?

\%o40 Matches the character specified with an octal number up to 0377. Numbers below 040 must be followed by a non-octal digit or a non-digit. \%x2a Matches the character specified with up to two hexadecimal characters. \%u20AC Matches the character specified with up to four hexadecimal characters.


1 Answers

An alternative to escaping the slash (\/) is to use the backward-search: ?</string> (and navigating to next matches with N instead of n).

like image 113
Ingo Karkat Avatar answered Oct 13 '22 13:10

Ingo Karkat