title: regex to remove the last word if it contains a character
body: <p>I need a regex in Python that will remove the last word from a string if it contains a certain character, in this case '#', and in other appearances of that character '#', only the character is removed, not the word.</p>
  
  <p>So the string:</p>
  
  <blockquote>
    <p>What a #great day #happy</p>
  </blockquote>
  
  <p>would become:</p>
  
  <blockquote>
    <p>What a great day</p>
  </blockquote>
  
  <p>so far I have tried</p>
  
  <pre><code>    entry = re.sub('(?&lt;=#)\w+','',entry) 
  </code></pre>
  
  <p>but this removes all words containing '#'. </p>