我有一些指向 archive.org 文件夹的链接,其中包含电影文件。例如:
https://archive.org/details/dmbb44435
电影文件名始终与文件夹名称相同。因此,在上面的示例中,电影是 dmbb44435.mp4。完整的 URL 如下:
https://archive.org/download/dmbb44435/dmbb44435.mp4
如何使用 notepad++ 通过 find+replace 将文件名添加到 URL 末尾?谢谢
答案1
- Ctrl+H
- 找什么:
https://archive.org/\Kdetails(/.+?(?!\.mp4))
- 用。。。来代替:
download$1$1.mp4
- 检查环绕
- 检查正则表达式
- Replace all
解释:
https://archive.org/ : literally
\K : forget all we have seen until this position
details : literally
( : start group 1
/ : a slash
.+? : 1 or more any character but newline, not greedy
(?!\.mp4) : negative lookahead, to make sure we don't have ".mp4" after
) : end group 1
替代品:
download : literally
$1 : content of group 1
$1 : content of group 1
.mp4 : literally
给定示例的结果:
https://archive.org/download/dmbb44435/dmbb44435.mp4