Path: utzoo!utgpu!water!watmath!clyde!att!rutgers!mailrus!ames!haven!umd5!adm!smoke!gwyn From: gwyn@smoke.ARPA (Doug Gwyn ) Newsgroups: comp.unix.wizards Subject: Re: what should egrep '|root' /etc/passwd print? Message-ID: <8492@smoke.ARPA> Date: 14 Sep 88 09:55:16 GMT References: <44414@beno.seismo.CSS.GOV> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 13 In article <44414@beno.seismo.CSS.GOV> rick@seismo.CSS.GOV (Rick Adams) writes: >What should > egrep '|root' /etc/passwd >print? The question of how to handle empty strings in regular expressions does not have a clear-cut answer. "sam", which has the most powerful regular expression mechanism of any of the editor-like programs I use, says the following: ?no operand for `|' which is yet another solution. (Getting the description right for where empty strings do and don't match was the hardest task when I was overhauling sam's manual entry.)