title: sed whole word search and replace
body: <p>How do I search and replace whole words using sed?</p>
  
  <p>Doing</p>
  
  <pre><code>sed -i 's/[oldtext]/[newtext]/g' &lt;file&gt; 
  </code></pre>
  
  <p>will also replace partial matches of <code>[oldtext]</code> which I don't want it to do.</p>