Files
06-Note/Python-100-Days/Day01-15/Day12/test5.py
sherlockforrest bf2ed2e31f 更新
2023-06-20 09:22:53 +08:00

13 lines
296 B
Python

import re
def main():
sentence = '你丫是傻叉吗? 我操你大爷的. Fuck you.'
purified = re.sub('[操肏艹草曹]|fuck|shit|傻[比屄逼叉缺吊屌]|煞笔',
'*', sentence, flags=re.IGNORECASE)
print(purified)
if __name__ == '__main__':
main()