I read the example in Python official docs reference to regex re.split()
>>> re.split(r'\W+', 'Words, words, words.')
['Words', 'words', 'words', '']
I am confused with the output, I guess it will produce
[",", ",", ","]
I think the following is legible:
In [100]: re.split(r',', 'Words, words, words.')
Out[100]: ['Words', ' words', ' words.']
How could (r'\W+', 'Words, words, words.'
output that match?