Use this one:
newLine = re.sub(r'[,]+(?![0-9])', r' , ', newLine)
Here using negative lookahead (?![0-9])
it is checking that the comma(s) are not followed by a digit.
Your regex didn't work because you picked the comma and the next character(using ([,]+[^0-9])
) in a group and placed space on both sides.
UPDATE: If it is not only comma and other things as well, then place them inside the character class []
and capture them in group \1
using ()
newLine = re.sub(r'([,/\\]+)(?![0-9])', r' \1 ', newLine)