re.findall -> Python 中的正则表达式

问题描述

import regex
frase = "text https://www.gamivo.com/product/sea-of-thieves-pc-xbox-one other text https://www.gamivo.com/product/fifa-21-origin-eng-pl-cz-tr"
x = regex.findall(r"/((http[s]?:\/\/)?(www\.)?(gamivo\.com\S*){1})",frase) 
print(x)

结果:

[('www.gamivo.com/product/sea-of-thieves-pc-xbox-one','','www.','gamivo.com/product/sea-of-thieves-pc-xbox-one'),('www.gamivo.com/product/fifa-21-origin-eng-pl-cz-tr','gamivo.com/product/fifa-21-origin-eng-pl-cz-tr')]

我想要类似的东西:

[('https://www.gamivo.com/product/sea-of-thieves-pc-xbox-one','https://gamivo.com/product/fifa-21-origin-eng-pl-cz-tr')]

我该怎么做?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)