You don't need regex. You can just use simple str.replace
:
>>> s = 'suppose_name_1'
>>> index = s.rfind('_') # Last index of '_'
>>> s.replace(s[index+1:], str(int(s[index+1:]) + 1))
'suppose_name_2'
If you need to first check whether you have digits at the end, you can check that using str.isdigit()
method:
>>> s = 'suppose_name'
>>>
>>> index = s.rfind('_')
>>> if s[index+1:].isdigit():
s = s.replace(s[index+1:], str(int(s[index+1:]) + 1))
>>> s
'suppose_name'