The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
search excat string in another string (grep "fails") bora99 UNIX for Dummies Questions & Answers 0 06-05-2008 03:41 AM
Search, replace string in file1 with string from (lookup table) file2? gstuart Shell Programming and Scripting 2 04-11-2008 11:32 AM
Perl: Search for string on line then search and replace text Crypto Shell Programming and Scripting 4 01-04-2008 06:24 AM
Search for a string sumesh.abraham Shell Programming and Scripting 12 12-11-2006 05:29 AM
appending string to text file based on search string malaymaru Shell Programming and Scripting 1 06-09-2006 05:53 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-23-2008
Registered User
 

Join Date: Oct 2007
Posts: 2
VI string search

Hi,
Can anybody please tell how to find a match line in vi if the line contains Str_a or Str_b? Inside the vi, I tried

:/(Str_a|Str_b)

it didn't work. Also I tried

:/\(Str_a|Str_b\)

didn't work either.

Thanks,
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-25-2008
Smiling Dragon's Avatar
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 643
In all implimentations of vi I know, it doesn't support |
Reply With Quote
  #3 (permalink)  
Old 05-25-2008
Registered User
 

Join Date: Mar 2008
Posts: 1
Hi,

For single character strings surround search with square brackets. If searching for 'a' and 'k' command would be /[ak]. To seach for 'a' to 'k' command is \[a-k].

Not sure if this helps you.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0