title: Regular expression for optional character in between the numerals
body: <p>I need to validate a string that contains underscore(_) in between the numbers. Underscore character is an optional.
  Only <em>condition is, it should be between the numbers</em>.</p>
  
  <pre><code>Valid     =&gt; 123
  Valid     =&gt; 1_23
  Valid     =&gt; 123_4567_89_312_575
  
  Not valid =&gt; 123_
  Not valid =&gt; _123
  Not valid =&gt; 123__12   (Two consecutive underscore characters)
  Not valid =&gt; _         (Number is mandatory)
  Not valid =&gt; abc       (only numbers and _ should be present)
  </code></pre>
  
  <p>I have tried this regular expression</p>
  
  <pre><code>([0-9]+_*[0-9]+)*
  </code></pre>
  
  <p>It failed. Any idea why ?</p>
  
  <p>PS:
  Going to implement this in swift language.
  Core logic: Underscore character is used like a separator for numbers.</p>