【发布时间】:2021-06-05 12:41:35
【问题描述】:
我之前看到过这个问题:python removing references from a scientific paper 这与我想要做的类似,但我仍然无法弄清楚如何去做,假设我的字符串我有这样的参考,例如:Poteete et al . (2010) 如何在 python 中使用正则表达式从字符串中删除它?
我尝试过的与上一个问题相似,但也许我忘记了某事:
sentence = "Moreover, we elaborate on how these methods have led to improved insights into the theoretical framework proposed by Poteete et al. (2010)"
sentence = re.sub(r'(?:[\w \.])+[0-9]{4}','',sentence)
对此有什么想法吗?非常感谢您的帮助。
【问题讨论】: