re.sub的常规使用re.sub(r"<.*?>| |\n", “”, text) # 清洗html的特殊符号((?=[\x21-\x7e]+)[^A-Za-z0-9]) #匹配各种特殊字符var patrn = /[`!@#$%^&*()_-+=<>?:"{}|,./;’\[]·!@#¥%……&*()——-+={}|《》?:“”【】、;‘’,。、]/im; 这个匹配所有键盘上可见的非字母和数字的符号