将字符串拆分为具备多个单词边界定界符的单词 - Split Strings into words with multiple word boundary delimiters

问题:

I think what I want to do is a fairly common task but I've found no reference on the web. 我认为我想作的是一项至关普通的任务,可是我在网络上找不到任何参考。 I have text with punctuation, and I want a list of the words. 个人文字带有标点符号,我想要一个单词列表。 web

"Hey, you - what are you doing here!?"

should be 应该 网络

['hey', 'you', 'what', 'are', 'you', 'doing', 'here']

But Python's str.split() only works with one argument, so I have all words with the punctuation after I split with whitespace. 可是Python的str.split()仅适用于一个参数,所以在用空格分割后,全部单词都带有标点符号。 Any ideas? 有任何想法吗? ide


解决方案:

参考一: https://stackoom.com/question/4Rdf/将字符串拆分为具备多个单词边界定界符的单词
参考二: https://oldbug.net/q/4Rdf/Split-Strings-into-words-with-multiple-word-boundary-delimiters
相关文章
相关标签/搜索