LINUX programming

Moderators: ITA
Number of threads: 1339
Number of posts: 2924

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
vi editor doubt ? Posted by ssvasan on 10 Sept 2004 at 7:45 AM
hi,

how can i search more than one values in a text file opened in vi editor.

i.e, to do a forward search we use /searchstring and to do a backward search we use ?searchstring, but, how can i check more than one search string in a file, as we are doing in grep family of commands.

thanks in advance

- sri


Report
Re: vi editor doubt ? Posted by abc on 16 Sept 2004 at 8:23 AM
bearing in mind you need to escape parantheses and the logical 'or':

/\(string1\)\|\(string2\)
Report
Re: vi editor doubt ? Posted by ssvasan on 22 Sept 2004 at 8:10 AM
Hi,

This option not working, it always displays pattern not found error.
I want to check more than one string is it possible, but it is possible in grep, but within vi editor can able to check more than one search string ?

thanks

- sri.



: bearing in mind you need to escape parantheses and the logical 'or':
:
: /\(string1\)\|\(string2\)
:






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.