LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   using grep and egrep in the terminal (https://www.linuxquestions.org/questions/linux-newbie-8/using-grep-and-egrep-in-the-terminal-598777/)

KumARan23 11-11-2007 08:14 AM

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.

druuna 11-11-2007 08:24 AM

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.

pixellany 11-11-2007 08:40 AM

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.

Disillusionist 11-11-2007 09:27 AM

OK

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

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]+$)


All times are GMT -5. The time now is 06:41 AM.