【发布时间】:2019-06-19 21:20:23
【问题描述】:
我想从其中没有特定单词的页面源中提取 mp3 url。
这是我用来搜索 mp3 url 的正则表达式:
https?:\/\/.+\.mp3
它工作正常。现在我想排除那些包含特定单词的网址。所以,我需要其中没有特定单词的网址。
如何排除http 和.mp3 之间的单词?
我将在带有 C++ 的 Qt 中使用它,但只要它适用于 https://regex101.com/ 就可以了。
【问题讨论】:
-
@CertainPerformance - 不,那是不同的。如果您阅读说明,它会显示
contains 123 somewhere in the middle。但是,我希望表达式不包含单词。 -
完全一样——看问题的最后一部分,
and there are no other instances of abc or xyz in the substring besides the start and the end.——就像上面的答案防止abc出现在比赛中间一样,你只需要应用相同的符合您的模式的逻辑。