title: Regex for Comma Separated Number
body: <p>I'm trying to validate user input, which is just comma separated numbers. I'd like to do this with RegEx, but can't come up with the right expression.</p>
  
  <p>It should validate the following strings (and larger):</p>
  
  <pre><code>1
  12
  123
  1,234
  12,345
  123,456
  </code></pre>
  
  <p>and invalidate the following strings (and crazier):</p>
  
  <pre><code>1,1
  1,12
  12,1
  12,12
  123,1
  123,1
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>Here's what I've tried so far (EDIT: which don't work), along with several variants -></p>
  
  <pre><code>^(((\d{1,3},)*\d{3})|(\d{1,3}))$
  ^(\d{1,3}[,])*\d{3}|\d{1,3}$
  </code></pre>