Closed longlongvip closed 2 years ago
我使用的是Python的re模块
import re
re_s = r"^https?:\/\/(.+\/)+.+(.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$"
s = "https://imgs.gamersky.com/upimg/new_preview/2022/02/14/origin_b_202202141847474965.jpg"
v = re.findall(re_s, s, re.IGNORECASE)
print(v)
print(len(v))
[('imgs.gamersky.com/upimg/new_preview/2022/02/14/', '.jpg', 'jpg')] 1
输出为什么不是https://imgs.gamersky.com/upimg/new_preview/2022/02/14/origin_b_202202141847474965.jpg
re_string = r"https?:\/\/(.+\/)+(.+)(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif)"
文本:
问题:为什么一个图片的url也提取不到?