title: UK bank sort code javascript regular expression
body: <p>I'm trying to create a regular expression in javascript for a UK bank sort code so that the user can input 6 digits, or 6 digits with a hyphen between pairs. For example "123456" or "12-34-56". Also not all of the digits can be 0.
  So far I've got <code>/(?!0{2}(-?0{2}){2})(\d{2}(-\d{2}){2})|(\d{6})/</code> and this <a href="http://jsfiddle.net/sd88a/1/" rel="noreferrer">jsFiddle to test.</a></p>
  
  <p>This is my first regular expression so I'm not sure I'm doing it right. The test for 6 0-digits should fail and I thought the <code>-?</code> optional hyphen in the lookahead would cause it to treat it the same as 6 0-digits with hyphens, but it isn't. 
  I'd appreciate some help and any criticism if I'm doing it completely incorrectly!</p>