How to split() by multiple characters?

Nick Forest nforest at airpost.net
Thu May 8 04:38:16 EDT 2003


Given an piece of text in a long string, how to split() it by ',' or '.' or ';' ...

i.e. text.split ( '[,.;]' )

Of course, the code doesn't work. :-(
Is there any good way to do this?




More information about the Python-list mailing list