Open this example in the interactive library
Source code
import re
print(re.split(r'[,;]+', 'red,green;blue'))Sample output
['red', 'green', 'blue']

Split on multiple delimiters. A self-contained example using the Python standard library.
Open this example in the interactive library
import re
print(re.split(r'[,;]+', 'red,green;blue'))['red', 'green', 'blue']