title: Get last set of numbers from string, do math, rebuild back into string?
body: <p>I have a field representing an "Account Number" that is anything but a number most of the time. I need to do some auto-incrementing of these "numbers". Clearly non-ideal for doing math with. The rule that we've decided works for us is that we want to <strong>find the right-most group of numbers and auto-increment them by one</strong> and return the rebuilt string (even if this makes it one character longer).</p>
  
  <p>Some examples of the numbers are:</p>
  
  <ul>
  <li>AC1234 -> AC1235</li>
  <li>GS3R2C1234 -> GS3R2C1235</li>
  <li>1234 -> 1235</li>
  <li>A-1234 -> A-1235</li>
  <li>AC1234g -> AC1235g</li>
  <li>GS3R2C1234g -> GS3R2C1235g</li>
  <li>1234g -> 1235g</li>
  <li>A-1234g -> A-1235g</li>
  <li>999 -> 1000</li>
  <li>GS3R2C9999g -> GS3R2C10000g</li>
  </ul>
  
  <p>I'm working with C#/.NET 4.0. I listed Regex as a tag but that isn't a requirement. This solution need not be in Regular Expressions.</p>
  
  <p>Any thoughts on a good way to do this? Ideal performance isn't a major concern. I'd rather have clear and easy-to-understand/maintain code for this unless it's all wrapped up in a Regex.</p>
  
  <p>Thanks!</p>