title: Regular Expression for numbers unless all digits are identical
body: <p>I need help to write a regular expression to match numbers which may be broken up into sections by spaces or dashes e.g: </p>
  
  <pre><code>606-606-606
  606606606
  123 456-789
  </code></pre>
  
  <p>However, matches should be rejected if all the digits of the number are identical (or if there are any other characters besides <code>[0-9 -]</code>):</p>
  
  <pre><code>111 111 111
  111111111
  123456789a
  </code></pre>
  
  <p>If spaces/dashes weren't allowed, the Regex would be simple:</p>
  
  <pre><code>/^(\d)(?!\1*$)\d*$/
  </code></pre>
  
  <p>But how would I allow dashes and spaces in the number?</p>
  
  <p>EDIT</p>
  
  <p>How would I allow also letters in the same regex (dashes and spaces shoud be still allowed) e.g:</p>
  
  <p>aaaaa - it's not ok</p>
  
  <p>aa-aaa-aaa-aaaaa - it's not OK</p>
  
  <p>ababab - it's OK</p>
  
  <p>ab-ab-ab - it's OK</p>
  
  <p>This rule checks only numbers.</p>
  
  <pre><code>^(?!(?:(\d)\1+[ -]*)+$)\d[\d- ]+$
  </code></pre>