re.split
https://docs.python.org/ja/3/library/re.html#re.split
string を、出現した pattern で分割します。
pattern 中でキャプチャの丸括弧が使われていれば、パターン中の全てのグループのテキストも結果のリストの一部として返されます。
code:分割に使うパターンも結果に含まれている.py
>> re.split(r'(\W+)', 'Words, words, words.')
'Words', ', ', 'words', ', ', 'words', '.', ''