demo_regex_split.py:
import re #Split the string at every white-space character: str = "The rain in Spain" x = re.split("\s", str) print(x)
➜ begtut>python demo_regex_split.py
['The', 'rain', 'in', 'Spain']