grep(1) has a -o
flag that outputs only the matching part of the line. From the man page:
-o, --only-matching
Show only the part of a matching line that matches PATTERN.
Your pattern isn't right to get the output you want, though. Try:
$ egrep -o 'key \w+' file
key word1
key word2