title: Need to prevent repeating characters using RegEx
body: <p>How can I use RegEx to test for the following pattern:</p>
  
  <ol>
  <li>String must be 4-10 characters long</li>
  <li>String must not have any repeating
  characters (no two characters can be the same and be next to each other)</li>
  </ol>
  
  <p>I have researched this and I think I am close with: </p>
  
  <pre><code>^(?!(.)\1).{4,10}$
  </code></pre>
  
  <p>This will correctly find a match for both <code>ab12</code> and <code>12ab</code>. It also correctly rejects <code>1111</code> and <code>aaaa</code>. However it wrongly accepts <code>12aa</code> and <code>ab11</code>.</p>
  
  <p>It seems to only look for the repeating characters at the beginning of the string. I have tried to move or remove the <code>^</code> and the <code>$</code>, but I need them for the max character check. I have also tried several variations of <code>(.)\1</code> to find repeating characters with no luck.</p>
  
  <p>Any help or hints would be greatly appreciated. </p>
  
  <p>PS - In case someone knows the answer, I actually want to allow a maximum of one pair of repeating characters but I decided this was too hard and decided to just disallow any repeating characters.</p>