1.问题
在使用正则表达式时出现re.error: nothing to repeat at position 14错误
fileters = ['#', '$', '%', '&', '<', '.', '>', '*', '?']
content = re.sub('|'.join(fileters)," ",content)
错误
2.原因
在fileters中出现了'.'、'*'、'?' ,这些字符在正则表达式的规则中是想当于关键字存在的,不可以直接使用。
3.解决办法
将fileters修改为下面语句
fileters = ['#', '$', '%', '&', '<', '[.]', '>', '[*]', '[?]']