import re
pattern='黑客|破解|反爬'
s='我想学习python,像破解一些视频,python可以实现无底线反爬吗?'
new_s=re.sub(pattern,'ooxx',s)
print(new_s)
s2='https://www.baidu.com/s?wd=ysj&rsv_spt=1'
pattern2='[?|&]'
lst=re.split(pattern2,s2)
print(lst)
(仅供参考)
发布于 2024-11-16 1742 次阅读
import re
pattern='黑客|破解|反爬'
s='我想学习python,像破解一些视频,python可以实现无底线反爬吗?'
new_s=re.sub(pattern,'ooxx',s)
print(new_s)
s2='https://www.baidu.com/s?wd=ysj&rsv_spt=1'
pattern2='[?|&]'
lst=re.split(pattern2,s2)
print(lst)
(仅供参考)
Comments NOTHING