import re s0 = 'BOY and GIRL' s1 = re.sub(r'BOY|GIRL', 'HUMAN', s0) print s1 # HUMAN and HUMAN 替换方法。 相关文章: 2021-11-24 2022-12-23 2021-06-15 2022-02-10 2021-06-05 2022-12-23 2022-12-23