String splitting in Python

delimiter, python, split, string

Solution

In order to split on multiple sequences you could simply replace all of the sequences you need to split on with just one sequence and then split on that one sequence.

So

s = s.replace("z", "s")
s.split("s")

Will split on s and z.

Problem

Is there a way to split a string in Python using multiple delimiters instead of one? `split` seems to take in only one parameter as delimiter. Also, I cannot import the `re` module. (This is the main stumbling block really.) Any suggestions on how I should do it? Thanks!

Original source