with re.split you can split on any sequence of space characters and commas : Split : Regular Expressions PYTHON TUTORIALS


PYTHON TUTORIALS » Regular Expressions » Split »

 

with re.split you can split on any sequence of space characters and commas


import re

some_text = 'alpha, beta,,,,gamma delta'

print re.split('[, ]+', some_text)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Regular Expressions
» Split