you can split a string on all non-word characters with re.split: >>> import re >>> re.split(r'\W', 'hello world, 2020-04-06, 333/blabla') ['hello', 'world', '', '2020', '04', '06', '', '333', 'blabla'] #python #python_tip