title: Using grep or sed to substitute words not matching a pattern
body: <p>I am new to the regular expression paradigm and I've encountered a problem I'm trying to solve, with no success.</p>
  
  <p>Imagine a file test.txt with:</p>
  
  <pre><code>hello everyone, whatsi up
  i hope my program worksa
  if it doesnt... ho well!
  </code></pre>
  
  <p>I would like to output to another file output.txt only the words that start with a consonant and end with a vowel so it would result in:</p>
  
  <pre><code>hello whatsi
  hope worksa
  ho
  </code></pre>
  
  <p>I am using <code>grep -o '\b[^ aeiouAEIOU]\w*[aeiouAEIOU]\b' test.txt &gt; output.txt</code> however, the <code>-o</code> flag outputs every matched string onto a new line. What should I do to get the format that I want? Another valid option would be to substitute everything that doesn't match that pattern with a blank space using sed but I failed to do it as well. Should I be using sed or awk instead?</p>
  
  <p>Thanks</p>