title: Regex to check for a repeating digit
body: <p>I have a Java application where users must specify a PIN to log in. When creating the PIN, there are only 3 requirements:  </p>
  
  <ul>
  <li><p>Must be 6 digits:  </p>
  
  <pre><code>\\d{6}
  </code></pre></li>
  <li><p>Must not have 4 or more sequential numbers:  </p>
  
  <pre><code>\\d*(0123|1234|2345|3456|4567|5678|6789)\\d*
  </code></pre></li>
  <li>Must not have a digit repeating 3 or more times (such as 000957 or 623334 or 514888): 
  This is where I'm stuck...</li>
  </ul>
  
  <p>I have tried:</p>
  
  <pre><code>\\d*(\\d)\\1{3}\\d*
  </code></pre>
  
  <p>but I believe the <code>\1</code> is looking at the initial match to the <code>\d*</code> not the second match of <code>(\d)</code>.</p>
  
  <p><hr>
  Answer used:
  I have updated to using:  </p>
  
  <pre><code>\\d{6}
  (0123|1234|2345|3456|4567|5678|6789|9876|8765|7654|6543|5432|4321|3210)
  \\d*?(\\d)\\1{2,}\\d*
  </code></pre>
  
  <p>To satisfy the initially stated requirements plus a few I hadn't thought of! Thanks for all the help</p>