import re
tests = ['0ABCD TECHNOLOGIES SERVICES',
'ABCD0 TECHNOLOGIES SERVICES',
'ABCD 0TECHNOLOGIES SERVICES',
'ABCD TECHNOLOGIES0 SERVICES',
'ABCD TECHNOLOGIES 0SERVICES',
'ABCD TECHNOLOGIES SERVICES0']
rx = re.compile(r'(?<=\d)(?=[^\d\s])|(?<=[^\d\s])(?=\d)')
for test in tests:
print(rx.sub(' ', test))
aW1wb3J0IHJlCnRlc3RzID0gWycwQUJDRCBURUNITk9MT0dJRVMgU0VSVklDRVMnLAonQUJDRDAgVEVDSE5PTE9HSUVTIFNFUlZJQ0VTJywKJ0FCQ0QgMFRFQ0hOT0xPR0lFUyBTRVJWSUNFUycsCidBQkNEIFRFQ0hOT0xPR0lFUzAgU0VSVklDRVMnLAonQUJDRCBURUNITk9MT0dJRVMgMFNFUlZJQ0VTJywKJ0FCQ0QgVEVDSE5PTE9HSUVTIFNFUlZJQ0VTMCddCgpyeCA9IHJlLmNvbXBpbGUocicoPzw9XGQpKD89W15cZFxzXSl8KD88PVteXGRcc10pKD89XGQpJykKCmZvciB0ZXN0IGluIHRlc3RzOgoJcHJpbnQocnguc3ViKCcgJywgdGVzdCkp