gpt4 book ai didi

javascript - 在 ubot 中使用正则表达式匹配图像

转载 作者:行者123 更新时间:2023-12-03 05:46:24 24 4
gpt4 key购买 nike

我尝试在 ubot studio 中使用正则表达式仅匹配具有相同分辨率的图像。

我想要匹配的示例图像网址:

http://sample.com/Image/e7b89db921da411bae9eea3c1333f287/201605/word/word/640/480/imagename.jpeg
http://sample.com/Image/a3c133e411bae9ee3f287b89db921da7/201504/word/word/640/480/imagename2.jpeg
http://sample.com/Image/41187b89db921dbae9ee3f2a3c133ea7/201505/word2/word/640/480/imagename3.jpeg

但不匹配图像,例如: http://sample.com/Image/fdsfsdf.jpeg或其他图像。我从 ^(http.+)\.jpeg$ 开始,但这匹配所有图像。我需要这样的东西:

http://sample.com/Image/*/*/word/word/640/480/*.jpeg

最佳答案

您的某个网址包含 word2,因此您的正则表达式不匹配。

试试这个 http:\/\/sample.com\/Image\/.*?\/.*?\/word2?\/word\/(\d+)\/(\d+)\/.*?\.jpeg

Sample

关于javascript - 在 ubot 中使用正则表达式匹配图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40318801/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com