【发布时间】:2020-01-21 16:38:57
【问题描述】:
我有一个文本片段:
.....https://www.one.com/privacy/\............http://two.com/terms/'.............https://three.com/pricing/\..........https://four.com/widget/wg74ythx;.........http://five.com/pricing .........
我提取网页链接的代码:
link = re.compile(r'https?://(\w.*?)(\\|;|\'|\s)')
但我需要从我的结果中排除所有带有“隐私”或“小部件”字样的链接。 我被困在这里,我需要社区的帮助。
【问题讨论】:
-
你能检查一下这些词的结果吗?
if 'privacy' in url:...
标签: python python-3.x regex-negation