【发布时间】:2017-03-19 14:56:27
【问题描述】:
只有在数字之间没有出现逗号和句点时,我才想从文本中删除它们。
所以,下面的文字应该返回
"This shirt, is very nice. It costs DKK ,.1.500,00,."
"This shirt is very nice It costs DKK 1.500,00"
我试过了
text = re.sub("(?<=[a-z])([[$],.]+)", " ", text)
但它不会替代文本中的任何内容。
【问题讨论】:
标签: python regex python-2.7