All in all you did a pretty go job.
Thanks Alan.
My routine is to do the following.
Locate the first valid number
Increment the number found by the desired amount.
Replace the found number with the new number with the matching format & precision.
As a bonus it should maintain leading and / or trailing zeros when applicable.
This kind of what mine does. It takes the string and makes a list out of it. It parses the string into a list of strings and lists ( if there are numbers within the string ). The list then states if it is a real or an integer. If it's a real, it tries to see what format it is in, and find out what precision it is.
The next function it gets passed to adds the number supplied to all numbers within the list. It also passes what the precision of the number supplied is, so that if it has a greater precision, then it will use that precision instead of the one the number has in the main string. And then it passes a list of strings back. Here it also tests to see if it is in a format that the command can use, if not is passes the same string back, and prints to the command line that one of the numbers was not a defined number that the command could use.
I must admit that you put in a little more thought than I did. And I never would have thought about leaving the leading zeros.
As you know I'm not there yet but I may have some time tomorrow to get back to it.
Biscuits gave me the weekend off.
Good idea to take the weekend off. Have fun.