Using grep or egrep

So a few months ago, I decided to move away from using grep and decided to use egrep in this code that i'm writing.

i figured egrep is more robust than grep.

well, it appears it isn't.

when i used egrep to search the log file for a script that looked like the following, egrep couldn't find the string:

(blah blah blah afafafafafaf System:) afafafafafafafa whatever

The egrep command I used was:

egrep '(blah blah blah afafafafafaf System:)'

And this command produced no output. However the grep command is able to pull out the search pattern just fine.

My question is, is there a way around this? I dont want to have to go back to grep. I want egrep to be able to do everything grep does but more. Isn't egrep a more advanced version of grep?

'egrep' works as expected on Solaris9.
try:

egrep '\(blah blah blah afafafafafaf System:\)' myFile

i dont want to have to include the "\".

this is on SunSolaris.

i guess i can search for different things on the string that egrep can pick up.

am i wrong in my belief that egrep is more powerful than grep?

It simply uses extended regular expressions by default instead of basic regular expressions. You can do the same with 'grep -E'.

In extended regular expressions, parenthesis are metacharactes which are used for grouping and capturing; thus, they must be escaped if they are to be matched literally. In basic regular expressions, the parenthesis are not metacharacters and must be quoted if they are to be used to capture or group.

Although egrep defaults to using a more powerful regular expression language, the command itself is not in any way more robust ... imo.

Regards,
Alister