title: replace a string containing a substring with a string in Python
body: <p>I need to replace a string containing a substring with another string. For example:</p>
  
  <pre><code>biography -&gt; biography
  biographical -&gt; biography
  biopic -&gt; biography
  bio-pic -&gt; biography-pic
  I watched a biographical movie -&gt; I watched a biography movie
  </code></pre>
  
  <p>Here, all words on the left contain <code>bio</code>, so the whole word is replaced by <code>biography</code>. I am aware of <code>string.replace()</code> function, but it doesn't seem to work well here. I looked up regular expressions, but I'm not sure if <code>re</code> is the right library to solve the problem.</p>