I wanted to cut up a string of email addresses which may be separated by any combination of commas and white-space.
And I thought it would be pretty straight-forward :
sep = re.compile('(\s*,*)+')
print sep.split("""[email protected], [email protected]
[email protected],,[email protected]""")
But it isn't. I can't find a regex that won't leave some empty slots like this :
['[email protected]', '', '[email protected]', '', '[email protected]', '', '[email protected]']
I've tried various combinations, but none seem to work. Is this, in fact, possible, with regex?