title: RegEx for JavaScript validation of comma separated numbers
body: <p>I have one text box and it can have values like <code>1</code> or <code>1,2</code> or <code>1,225,345,21</code> (i.e., multiple values). But now I want to validate this input.</p>
  <pre><code>toString().match(/^(([0-9](,)?)*)+$/)
  </code></pre>
  <p>This is the code I'm using. It is validating correct only, but one problem when the user enters values like this:</p>
  <pre><code>inputval:1,22,34,25,645(true)
  inputval:1,22,34,25,645,(false)
  </code></pre>
  <p>When the user enters a comma (<code>,</code>) at the end, it should throw an error.</p>
  <p>Can any one help me please?</p>