Subject: printing a regular expression match
To: None <netbsd-users@netbsd.org>
From: Michael Gorsuch <michael.gorsuch@gmail.com>
List: netbsd-users
Date: 12/08/2006 10:06:46
Hey all, I'm trying to find the right Unix tool to print out a matched
regular expression, not just a line that matches.

For example,

echo [1234] | egrep \(1234\)

It matches the expression, but I only want to print the match, '1234'.

Any ideas?  I'm sure there's a unix tool I'm not using properly here...

Thanks,

Michael