LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   VI: how to search with two keywords (https://www.linuxquestions.org/questions/linux-software-2/vi-how-to-search-with-two-keywords-650017/)

Niceman2005 06-17-2008 09:35 PM

VI: how to search with two keywords
 
Dear friends,

How do i do a search with Vi for a criteria of two keywords?
I know if we need to search a keyword (say apple), we can type /apple, if we wish to search a sentence with both apple and orange, how do we execute?

thanks for helping!

bigrigdriver 06-17-2008 10:18 PM

Start vim. Enter ":help search". Scroll down to the page until you find this:
Quote:

Example for using some flags: >
:echo search('\<if\|\(else\)\|\(endif\)', 'ncpe')
That's the section that tells how to specify more that one search word.

Niceman2005 06-18-2008 08:17 PM

thanks friend!


All times are GMT -5. The time now is 02:20 AM.