what's up with the $?

Can you do this with a normal grep regex or sed instead?