按照以上写法,理解打印的是把汉字替换为空格后的内容,但实际却是反过来的,即打印的是把非汉字替换为空格后的内容。还请熟悉的童鞋解答下!strs = 'Hello. 先生. What can i do for you? . 你好'strs = re.sub(r'[\u4e00-\u94a5]', ' ', strs)print(strs)
我运行是正确的