> > ['ab', 'd', '', 'ab', '', ''] > > Given your original string, I'm not sure how that would be the > expected result of "split c on the characters in dels".
Oops, the inner loop should be: for i in xrange(0,len(c)): Now it works. > >>> c=' abcde abc cba fdsa bcd ' > >>> import re > >>> r = re.compile('[ce ]') > >>> r.split(c) > ['', 'ab', 'd', '', 'ab', '', '', 'ba', 'fdsa', 'b', 'd', ''] > > given that a regexp object has a split() method. That's probably optimum solution. Thanks! Regards, Marcin -- http://mail.python.org/mailman/listinfo/python-list