I am trying to get all the word pairs out of a piece of text.
I have the following regular expression (\w+) +(\w+) that I run on a piece of text with no punctuation. My issue is this does not consider all possible pairs
$ echo "hello dear world" | grep -Eoi "(\w+) +(\w+)"
hello dear
I want the following
$ echo "hello dear world" | grep -Eoi [some expression]
hello dear
dear world