V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  whusnoopy  ›  全部回复第 53 页 / 共 53 页
回复总数  1041
1 ... 44  45  46  47  48  49  50  51  52  53  
因为 Python 需要用圆括号括起来你要匹配的部分,参考下面

```python
>>> re.findall(r'( https://.+?(jpg|gif))', 'https:///i.imgur.com/TA3T3gU.gifhttps://i.redd.it/msevs1zayzg11.jpghttps://i.redd.it/msevs1zayzg11.jpg')
[('https:///i.imgur.com/TA3T3gU.gif', 'gif'), ('https://i.redd.it/msevs1zayzg11.jpg', 'jpg'), ('https://i.redd.it/msevs1zayzg11.jpg', 'jpg')]
```
1 ... 44  45  46  47  48  49  50  51  52  53  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3212 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 12:26 · PVG 20:26 · LAX 04:26 · JFK 07:26
Developed with CodeLauncher
♥ Do have faith in what you're doing.