Split text on paragraphs where paragraph delimiters are non-standard

早过忘川 提交于 2019-12-03 14:20:08

The regex solution you propose seems elegant enough:

re.split('\s{4,}',text)

This uses 4 consecutive whitespace chars as paragraph delimiter. You can use '\n\s{3,}' or something similar, if it fits better.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!