That is odd; I've looked at that example before but didn't notice "number" in it. I would presume this would be a better way of writing it:
return 'Y' + str(int(m.group(1)) + 1)
The key point is that what you get out of the regex routines is a string, to add 1 to it you have to convert it to a number, and then to concatenate it to as string, it needs to be made back into a string.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I saw inside the doc – Editor.rereplace() – a statement like that :
I don't know what do you mean by "number" ?
That is odd; I've looked at that example before but didn't notice "number" in it. I would presume this would be a better way of writing it:
return 'Y' + str(int(m.group(1)) + 1)
The key point is that what you get out of the regex routines is a string, to add 1 to it you have to convert it to a number, and then to concatenate it to as string, it needs to be made back into a string.
Ok, thank you. Number is what you want convert in number before string...