I would like to parse a string to get a list, including all words (portable words too). Current code:
s = '-this is. A - sentence;one-word'
re.compile("\W+",re.UNICODE).split(s)
returns:
['', 'this', 'is', 'A', 'sentence', 'one', 'word']
and I would like him to return:
['', 'this', 'is', 'A', 'sentence', 'one-word']
source
share