LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 06-17-2008, 09:35 PM   #1
Niceman2005
Member
 
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, 10:18 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,746

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
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.
 
Old 06-18-2008, 08:17 PM   #3
Niceman2005
Member
 
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330

Original Poster
Rep: Reputation: 30
thanks friend!
 
  


Reply


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 10:37 AM
Help with keywords please ! DarkLeon Linux - Newbie 7 11-06-2006 03:37 PM
MySQL: search for pluralized keywords using RegEx? MicahCarrick Programming 1 09-26-2006 08:50 PM
LXer: Open source search technology goes beyond keywords LXer Syndicated Linux News 0 09-26-2006 02:21 AM
Linux Keywords Westdog976 Linux - Newbie 4 06-13-2003 03:00 AM


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

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