Simple regex split
- by user1383058
I have the following string:
string = "Peter Pan, Pete Sampras; Little Pete"
And I need to split it up by name:
split_string = ["Peter Pan", "Pete Sampras", "Little Pete"]
I am trying to use re.findall but am having a bit of trouble with it:
print re.findall(r'[,;]', string)
[";", ";", ";"]
What am I doing wrong here and how would I properly use re.findall here or an equivalent to split up the string?