I have some lines in a file like:
This is one word1:word2 of the lines
This is another word3:word4 of the lines
Line without a match
Yet another line word5:word6 for test
I need to grep for :
and to return words just before and after :
.
Output I need from greping above lines is
word1:word2
word3:word4
word5:word6