self.content = re.sub(r'>|<',lambda x: '>' if x.group()[0] == '>' else '<' , self.content) #content是要匹配的内容,lambda函数才是真正的替换 相关文章: 2021-11-22 2022-12-23 2022-03-02 2021-07-07 2022-01-18 2022-02-26 2022-01-17 2021-08-09