title: regexp to match string with (comma-separated) number at start and to split into number and rest?
body: <p>Given a string such as:</p>
  
  <p><code>23,234,456 first second third</code></p>
  
  <p>How can I split string this into two parts, where part 1 contains the number <em>at the beginning</em> and part 2 contains the rest---but only if the string STARTS with a number, and the number can be comma-separated or not?  In other words, I want two results: <code>23,234,456</code> and <code>first second third</code>.  If there's a number in that string that isn't part of the first number then it should be in the second result.</p>
  
  <p>My best stab at this so far, to grab the number at the beginning, is something like this:</p>
  
  <p><code>^[0-9]+(,[0-9]{3})*</code></p>
  
  <p>Which seems to grab a comma-separated or non-comma-separated number that starts the line.  However, when I run this in the Javascript console I get not only the full number, but also a match on just the last 3 digits with their preceeding <code>,</code>.  (e.g. <code>23,234,456</code> and <code>,456</code>).  </p>
  
  <p>As for getting the rest into another var I'm having trouble.  I tried working with <code>\b</code>, etc., but I think I must be missing something fundamental about grabbing the rest of the line.</p>
  
  <p>I'm doing this in Javascript in case it matters.</p>
  
  <p>More examples of what to match and what not to match.</p>
  
  <p><code>2 one two three</code> should return <code>2</code> and <code>one two three</code></p>
  
  <p><code>2345 one two three</code> should return <code>2345</code> and <code>one two three</code></p>
  
  <p><code>2 one 2 three</code> should return <code>2</code> and <code>one 2 three</code></p>
  
  <p><code>2,234 one two 3,000</code> should return <code>2,234</code> and <code>one two 3,000</code></p>
  
  <p>The space between parts 1 and two could be included in the beginning of part 2.</p>