Com o GNU grep
:
start cmd:> echo "This is one word1:word2 of the lines" |
grep -Eo '[[:alnum:]]+:[[:alnum:]]+'
word1:word2
start cmd:> echo "This is one wordx:wordy of the lines" |
grep -Eo '[[:alpha:]]*:[[:alpha:]]*'
wordx:wordy
start cmd:> echo "This is one wo_rdx:wo_rdy of the lines" |
grep -Eo '[[:alpha:]_]*:[[:alpha:]_]*'
wo_rdx:wo_rdy