title: Regex allow only one dash or only one space
body: <p>I want an expression that allows number and one dash OR number and one space. Space or dash are optional.
  I tried this</p>
  
  <pre><code>/^([0-9]+(-[0-9]+)?)|([0-9]+(\s[0-9]+)?)$/
  </code></pre>
  
  <p>Accepted regular expressions:</p>
  
  <ol>
  <li>11-222</li>
  <li>444 99</li>
  </ol>