title: Regular expression: matching words between white space
body: <p>Im trying to do something fairly simple with regular expression in python... thats what i thought at least.</p>
  
  <p>What i want to do is matching words from a string if its preceded and followed by a whitespace. If its at the beginning of the string there is no whitespace required before - if its at the end, dont't search for whitespace either.</p>
  
  <p>Example:</p>
  
  <pre><code>"WordA WordB WordC-WordD WordE"
  </code></pre>
  
  <p>I want to match <code>WordA WordB WordE</code>.</p>
  
  <p>I only came up with overcomplicated way of doing this...</p>
  
  <pre><code>(?&lt;=(?&lt;=^)|(?&lt;=\s))\w+(?=(?=\s)|(?=$))
  </code></pre>
  
  <p>It seems to me there has to be a simple way for such a simple problem....
  I figured i can just start with <code>(?&lt;=\s|^)</code> but that doesnt seem possible because "look-behind requires fixed-width pattern".</p>