Operating System - HP-UX
1752548 Members
5084 Online
108788 Solutions
New Discussion юеВ

Re: searhing multiple words in vi

 
SOLVED
Go to solution
Shivkumar
Super Advisor

searhing multiple words in vi

Hi,

Is there a command to search in vi words
which starts with a paricular word and ends with another particular word ?

I know the command which searches only one word in vi.

Thanks,
Shiv
3 REPLIES 3
Steven E. Protter
Exalted Contributor
Solution

Re: searhing multiple words in vi

Shalom Shiv,

Shlash to start the search function.

"Search vi"

Enclose the search parameter in double quotes.

This stops the tool from interpreting the space as end of search parameter.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jonathan Fife
Honored Contributor

Re: searhing multiple words in vi

You can do text matching for any phrase (within a single line) that starts with word1 and ends with word2 like so:

:/word1.*word2

The . signifies any character and the * means zero or more of the character just specified, so together they means zero or more of any character.
Decay is inherent in all compounded things. Strive on with diligence
Arunvijai_4
Honored Contributor

Re: searhing multiple words in vi

Hi Shiv,

vi cheat sheet which contains many tips and tricks : http://www.lagmonster.org/docs/vi.html

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"