Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-17-2008, 10:35 PM   #1
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330

Rep: Reputation: 30
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!
Old 06-17-2008, 11:18 PM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,846

Rep: Reputation: 342Reputation: 342Reputation: 342Reputation: 342
Start vim. Enter ":help search". Scroll down to the page until you find this:
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.
Old 06-18-2008, 09:17 PM   #3
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330

Original Poster
Rep: Reputation: 30
thanks friend!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
System keywords in RHEL 5 Ragnarok_Sunset Linux - General 0 06-09-2008 11:37 AM
Help with keywords please ! DarkLeon Linux - Newbie 7 11-06-2006 04:37 PM
MySQL: search for pluralized keywords using RegEx? MicahCarrick Programming 1 09-26-2006 09:50 PM
LXer: Open source search technology goes beyond keywords LXer Syndicated Linux News 0 09-26-2006 03:21 AM
Linux Keywords Westdog976 Linux - Newbie 4 06-13-2003 04:00 AM

All times are GMT -5. The time now is 02:45 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration