感谢大家的帮助,我走到了这一步,但我有一些新的问题,我希望有人能帮助我,我找到了下面的单词,我想用另一个词取代他们,但这段代码只适用于第一个单词text = 'Suddenly you said goodbye, even though I was passionately in love with you, I hope you stay lonely and live for a hundred years' matches = list(re.finditer(key,
根据我收到的关于这个问题的答案,我编辑了下面的regex。String1 = " I have total exp of 10-11 years. This includes 15yearsin SAS and 5 pat= re.compile(r'\d{1,3}(?:\W+\d{1,3})?\W+(?:plus\s*)?(?:year|month|Y