I have an input that looks like the following.
word1-word2
word1 word2
word1+word2
--word1--word2-
word1-word2
word1,word2,
(word1),word2
etc
I have to create a list that finally has ['word1','word2'] and nothing else in it. (It can have blanks that I can remove later I guess). There can be any special characters around the two words. Is there any straight forward way to do it? (a better regex??).
I am trying something in the following lines from the following link
Splitting a string with multiple delimiters in Python
re.split(r'[-+ ,]+', INPUT)
There isn't any consistency between special characters surrounding the two words.