title: Match specific length x or y
body: <p><em>I'd like a regex that is either X or Y characters long</em>. For example, match a string that is either 8 or 11 characters long. I have currently implemented this like so: <code>^([0-9]{8}|[0-9]{11})$</code>.</p>
  
  <p>I could also implement it as: <code>^[0-9]{8}([0-9]{3})?$</code></p>
  
  <p>My question is: <strong>Can I have this regex without duplicating the <code>[0-9]</code> part</strong> (which is more complex than this simple <code>\d</code> example)?</p>