Sachin
Sachin

Reputation: 21881

Searching for a specified word in the file opened in VI editor

Please tell me how to search for a specifig word if the file is opened in VI Editor. I know we can do it by using /word_to_be_search but it will not do the exact search for the word.

Example
/sachin will searches for sachin_server, sachin_client and not only sachin

Upvotes: 8

Views: 16958

Answers (3)

brianh
brianh

Reputation: 1

do this:

/\

Upvotes: -1

Paul Tomblin
Paul Tomblin

Reputation: 182762

/\<sachin\>

\< is the beginning of word, and \> is the end of word marker.

Upvotes: 4

Nick Dixon
Nick Dixon

Reputation: 875

Try instead:

/\<word\>

the \< and \> match word boundaries.

Upvotes: 20

Related Questions