Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

No subject



  In  basic  regular expressions the metacharacters ?, +, {,
    }, |, (, and ) lose their special meaning; instead use the
      backslashed versions \?, \+, \{, \}, \|, \(, and \).


So does grep '^\(fee\|fie\)' junk.txt work?

On Tue, Sep 02, 2003 at 11:35:48AM -0400, Ken Gosier wrote:
> Greetings, and I hope this isn't a "D'oh!" question that will make me kick
> myself.. :-)
> 
> I wanna use grep to match on lines in a file that begin with either of 2
> patterns. As far as I understand regex's, I should use ^(...|...) to do
> this, as in:
> 
> grep ^(fee|fie) junk.txt
...
> -- 
> Ken Gosier
> ken at kg293.net
> ken_gosier at yahoo.com

-- 
Mike Small
smallm at panix.com




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org