我有一个https链接数组,看起来像这样
list1 = ['https://wvva.com/news/top-stories/2018/12/10/w-va-gov-appoints-former-beckley-council-member-to-parole-board/','https://www.starbreeze.com/2018/12/starbreeze-appoints-claes-wenthzel-as-acting-cfo/','https://www.streetinsider.com/corporate+news/perkinelmer+%28pki%29+appoints+prahlad+singh+as+president+%26+coo/']
我想过滤包含"appoints"
作为一个必要关键字和'chief-operating-officer','ceo','chief-executive-officer','coo','cfo','chief-financial-officer','chief-marketing-officer','cmo','chief-technology-officer','cto'
作为其他必要关键字的链接。我的意思是,如果链接中包含“任命”和上述任何一个词,如[cto、ceo、coo等],那么请选择该链接。你知道吗
我的示例输出如下:
['https://www.starbreeze.com/2018/12/starbreeze-appoints-claes-wenthzel-as-acting-cfo/','https://www.streetinsider.com/corporate+news/perkinelmer+%28pki%29+appoints+prahlad+singh+as+president+%26+coo/']
对于这个问题的正则表达式将不胜感激。你知道吗
您可以循环浏览关键字,以在提供的任何链接中找到匹配的关键字
如果你正在拼命寻找正则表达式,你可以用这个
这里不需要正则表达式。您可以直接检查要在url列表中搜索的项目列表中是否存在任何项目;如果找到,请保留url:
相关问题 更多 >
编程相关推荐