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
egrep DNAx86 Shell Programming and Scripting 7 01-18-2008 05:59 AM
Egrep cheat sheet anywhere? Looking for meaning of egrep -c leelm UNIX for Dummies Questions & Answers 2 01-11-2008 12:37 PM
egrep syntax question DKNUCKLES Shell Programming and Scripting 1 11-18-2007 01:46 PM
Egrep Help FuzzyNips UNIX for Dummies Questions & Answers 2 11-10-2004 01:25 PM
egrep -f tine UNIX for Dummies Questions & Answers 2 06-25-2003 07:28 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 05-22-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
For egrep the limit on the number of allowed matches is expressed {lower,upper}

Code:
egrep '^a{1,6}$'
finds a line made only of one to six characters 'a' -s
Reply With Quote
Forum Sponsor
  #9  
Old 05-23-2006
Registered User
 

Join Date: May 2006
Posts: 7
question on egrep

Hi Ranj,
Your solution works for
egrep '^a(a)+$'

But can you tell me how to interpret this please?

How does this know it needs to select 2.. upto 6 a's ?

Thanks
Rohit
Reply With Quote
  #10  
Old 05-23-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
It doesn't limit the search to a maximum of 6 a's.
Example test with seven a's:
Code:
/home/jmcnama > echo "aaaaaaa" | egrep '^a(a)+$'
aaaaaaa
try it.
Reply With Quote
  #11  
Old 05-25-2006
Registered User
 

Join Date: May 2006
Posts: 7
question on egrep

Hi Jim,
Thanks for your response but my requirement was really limiting the selection between 2 and 6 a's. (or for that matter a user specified number).
Any clues ?

Rohit
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:54 AM.


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

Content Relevant URLs by vBSEO 3.2.0