title: Optional characters in a regex
body: <p>The task is pretty simple, but I've not been able to come up with a good solution yet: a string can contain numbers, dashes and pluses, or only numbers.</p>
  
  <pre><code>^[0-9+-]+$
  </code></pre>
  
  <p>does most of what I need, except when a user enters garbage like "+-+--+"</p>
  
  <p>I've not had luck with regular lookahead, since the dashes and pluses could potentially be anywhere in the string.</p>
  
  <p>Valid strings:</p>
  
  <ol>
  <li>234654</li>
  <li>24-3+-2</li>
  <li>-234</li>
  <li>25485+</li>
  </ol>
  
  <p>Invalid:</p>
  
  <ol>
  <li>++--+</li>
  </ol>