【发布时间】:2019-05-15 10:52:31
【问题描述】:
我有一个句子列表:
['hello', 'I would like to thank you', 'I would like to thank you. By the way']
当我找到“。”时,我需要将每个句子分成列表。 .
例如,在上面的例子中,预期的结果是:
['hello', 'I would like to thank you', 'I would like to thank you'. 'By the way']
我在 python 中尝试使用这段代码:
def split_pint(result):
for i in result:
i = re.split(r". ", i)
return result
但是句子没有被拆分。
有什么想法吗?
谢谢
【问题讨论】:
标签: python regex python-3.x