import re

s = "test001"
print(re.sub(r'^(\D+)(\d+)$', lambda x: rf'{x.group(1)}-{x.group(2).zfill(5)}', s))
