How to generate series for input containing character with number in python

Input contains mix of characters and numbers and last digits are numbers. I need to generate sequence user id containing characters and numbers

Input :

start of series : A10B00001 
number of entries : 100

Output :

A10B00001
A10B00002
A10B00003
A10B00004
.
.
A10B00100

Answer

Here is a solution using regex and format string:

import re


def series(serie, n=100):
    _, str_, int_ = re.split(r'(.*[a-z|A-Z])', serie)
    return [f'{str_}{(int(int_)+i):05d}' for i in range(n)]


print(series('A10B00001', n=5))
>>> ['A10B00001', 'A10B00002', 'A10B00003', 'A10B00004', 'A10B00005']