title: Regular expression - match all words but match unique words only once
body: <p>Is it possible to use a regular expression to match all words but match unique words only once? <strong>I am aware there are other ways of doing this however I'm interested in knowing if this is possible with the use of a regular expression.</strong></p>
  
  <p>For example I currently have the following expression:</p>
  
  <pre><code>(\w+\b)(?!.*\1)
  </code></pre>
  
  <p>and the following string:</p>
  
  <pre><code>glass shoes door window door glasses. window glasses
  </code></pre>
  
  <p>For the most part the expression works and matches the following words:</p>
  
  <pre><code>shoes
  door 
  window
  glasses
  </code></pre>
  
  <p>There are two issues with this:</p>
  
  <ol>
  <li><p>A match for a substring is being made on "glasses" with "glass",
  this is incorrect.</p></li>
  <li><p>"glasses" and "glasses." should match but currently do not.</p></li>
  </ol>
  
  <p>The final match should be:</p>
  
  <pre><code>shoes 
  door 
  window 
  glasses 
  glass 
  </code></pre>