title: single js regex for matching repeating substrings?
body: <p>Say I have a string, like:</p>
  
  <pre><code>where is mummy where is daddy
  </code></pre>
  
  <p>I want to replace any set of repeating substrings with empty strings - so in this case the <code>where</code> and <code>is</code> elements would be removed and the resulting string would be:</p>
  
  <pre><code>mummy daddy
  </code></pre>
  
  <p>I was wondering if there was any single regex that could achieve this. The regex I tried (which doesn't work) looked like the following:</p>
  
  <pre><code>/(\w+)(?=.*)\1/gi
  </code></pre>
  
  <p>Where the first capture group is any set of word characters, the second is a positive look ahead to any set of characters (in order to prevent those characters from being included in the result) and then the <code>\1</code> is a backreference to the first matched substring.</p>
  
  <p>Any help would be great. Thanks in advance!</p>