LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-11-2007, 09:14 AM   #1
KumARan23
LQ Newbie
 
Registered: Nov 2007
Posts: 5

Rep: Reputation: 0
using grep and egrep in the terminal


Create a file containing some lines that you think would match
the regular expression: (^[09]{1,5}[azAz]+$)|none and some
lines that you think would not match.
Use egrep to see if your
intuition is correct.
 
Old 11-11-2007, 09:24 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

This screams: Homework! Which we don't do for you (because I don't want to and because the LQ rules say so). Get to the chapter that deals with regular expressions, read the (e)grep man page.

If you get stuck on a specific issue, you can post it here and we can give you some pointers.
 
Old 11-11-2007, 09:40 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
This looks like your second "cut and paste" homework question.

There is a lot of misunderstanding about homework here. You ARE allowed to post homework questions. The rules only say that you should not expect us to actually do anything.

My rule: If you just cut and paste from the assignment sheet---and give no evidence of trying to solve the problem--I will not lift a finger to help you.

As a minimum, tell us what text they use in the class and where you are getting stuck.
 
Old 11-11-2007, 10:27 AM   #4
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,036

Rep: Reputation: 96
OK

I've done the exercise and it behaved pretty much as I expected

All the information you need is included in the question you posted. Cross reference your homework with the following:
Code:
man grep
BTW there are 186 unique combinations that match the regular expression (^[09]{1,5}[azAz]+$)
There are 248 unique combinations if (as I suspect) the regular expression should have been (^[09]{1,5}[azAZ]+$)

Last edited by Disillusionist; 11-11-2007 at 10:57 AM.
 
  


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
grep/egrep logical AND function? boozer_2 Linux - Newbie 11 04-10-2010 02:19 AM
diffrence between grep, sed, awk and egrep Fond_of_Opensource Linux - Newbie 3 08-18-2006 09:15 AM
egrep/grep regex question buldir Programming 7 05-08-2006 08:17 PM
Problem matching strings with grep/egrep Seb74 Linux - Newbie 5 05-26-2005 02:40 PM
Using Grep and Egrep linux-nerd Linux - General 5 10-10-2004 12:37 PM


All times are GMT -5. The time now is 05:37 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration