Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!guest From: guest@geech.ai.mit.edu (Guest Account) Newsgroups: comp.sys.3b1 Subject: Re: egrep on the 3b1 is weird! Message-ID: Date: 22 Mar 91 16:54:40 GMT References: <1268@hico2.UUCP> <8783@gollum.twg.com> <1311@hico2.UUCP> Sender: news@ai.mit.edu Organization: Guest at MIT Lines: 10 In-reply-to: kak@hico2.UUCP's message of 21 Mar 91 23:04:03 GMT Since without any kind of quoting or special chars a regular expression is 1 character: egrep 'foo|bar' matches lines containing fooar and fobar. That's why you need to use parentheses. You have to read the manual page for ed(1) to get the rest of the story on regular expressions. To quote the grep man page: "Egrep accepts regular expressions as in ed(1), except..." Daniel Guilderson ryan@cs.umb.edu