Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!unreplyable!garbage From: lin@CS.WMICH.EDU (Lite Lin) Newsgroups: comp.unix.questions Subject: Pattern matching with awk Message-ID: <9103040310.AA16551@cs.wmich.edu> Date: 4 Mar 91 03:10:51 GMT Sender: daemon@tut.cis.ohio-state.edu Lines: 14 This is a simple question, but I don't see it in "Freqently Asked Questions", so... I'm trying to identify all the email addresses in email messages, i.e., patterns with the format user@node. Now I can use grep/sed/awk to find those lines containing user@node, but I can't figure out from the manual how or whether I can have access to the matching pattern (it can be anywhere in the line, and it doesn't have to be surrounded by spaces, i.e., it's not necessarily a separate "field" in awk). If there is no way to do that in awk, I guess I'll do it with lex (yytext holds the matching pattern). Any response will be appreciated. Thanks, Lite