import re
s = '    5,    3,   , hello'
print(re.split('[\s,]+', s.strip()))