sed -n 's/.* MATCH: \([^ ]*\).*/\1/p'
Would print the sequence of non-space characters that follow the right-most occurrence of " MATCH: " on every matching line.
-n tells sed not to print the pattern space by default. And the p flag to the s command tells sed to print the pattern space (so the result of the substitution) if the substitution is successful.
So the:
sed -n 's/pattern/replacement/p'
is a common idiom to print the result of successful substitutions.
Note that the above assumes the input is valid text. Since .* matches any sequence of characters, it won't match on sequences of bytes that don't form valid characters. That typically happens in UTF-8 locales when processing text in another encoding. If you're in such a case, you may want to prefix that line above with LC_ALL=C. That makes sed treat each byte as a character so there's no possible invalid byte sequence. That would work here as the characters we're matching on are all from the portable character set.
Standard awk doesn't have anything equivalent as it doesn't support capture groups (the \(...\) captured in \1) in it's sub() function.
There, you need to resort to the match() function:
awk 'match($0, / MATCH: [^ ]*/) {
print substr($0, RSTART+8, RLENGTH-8)}'
Or use tricks like:
awk -F ' MATCH: ' 'NF>1 {sub(/ .*/, "", $2); print $2}'
(beware that those would consider the leftmost occurrence of " MATCH: ").
GNU awk has a gensub() function that has functionality similar to sed's s command, but a design mistake in that it doesn't tell you whether any substitution was done. Here, you could do:
gawk '(replacement = gensub(/.* MATCH: ([^ ]*).*/, "\\1", 1)) != $0 {
print replacement}'