Python 正则表达式替换敏感词 - 黑客、抓包、监听、Trojan
import re
d = r'(黑客)|(抓包)|(监听)|(Trojan)' text = str(input('请输入文本:'))
match = re.search(d, text)
if match: text = re.sub(d, '*', text)
print(text)
原文地址: http://www.cveoy.top/t/topic/Gh3 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
import re
d = r'(黑客)|(抓包)|(监听)|(Trojan)' text = str(input('请输入文本:'))
match = re.search(d, text)
if match: text = re.sub(d, '*', text)
print(text)
原文地址: http://www.cveoy.top/t/topic/Gh3 著作权归作者所有。请勿转载和采集!