title: Regular Expression find duplicate words
body: <p>I have a list of words, where some are the same. I need to find these duplicates to replace them with an empty string. I don't have any problems with the replacement inside python, but with the regular expression I try to use.
  This is an example of my list:</p>
  <pre><code>AC;AC MR;TA;AC MR;AC;AC MR;TA;SDA
  </code></pre>
  <p>The words are seperatet by a semicolon.</p>
  <p>The expression I use is:</p>
  <pre><code>\b(\w+\s*\w+)\b;(?=.*\1)
  </code></pre>
  <p>I tried it without the spaces between the words like that:</p>
  <pre><code>AC;ACMR;TA;ACMR;AC;ACMR;TA;SDA
  </code></pre>
  <p>The result I get here, when I replace the matches with nothing is:</p>
  <pre><code>ACMR;TA;SDA
  </code></pre>
  <p>What I want as an result in the end is:</p>
  <pre><code>AC;ACMR;TA;SDA
  </code></pre>
  <p>You can see that there is no AC. He always matches the standalone AC and replaces it, when it comes before the ACMR. But these are different words and I need one of every word in my result.</p>
  <p>Can someone help me with that?
  Thanks in advance</p>