简体   繁体   English

Notepad ++查找具有条件的所有正则表达式

[英]Notepad++ find all regular expression with condition

Title is pretty much self explanatory... 标题几乎可以自我解释...

I want to find a particular match but with condition. 我想找到一个符合条件的特定比赛。

I will give an example so it would be more clear: 我将举一个例子,这样会更清楚:

http://www.example.com//test.htm
https://www.example.com/test.htm
https://www.example.com///test.htm
ftp://www.example.com//myFile.jpg

I want to find all // but except the the http:// 我想查找所有//,但http://除外

so iow... 哇...

if there is a : character (http://) before the // ignore it... 如果有一个:字符(HTTP://)前//忽略它...

return only matches that do not have : before // 仅返回不具有: //之前的匹配项

The answer provided by @georg would work for your case, if you want to make sure you're ignoring those specific conditions; 如果您要确保忽略这些特定条件,@ georg提供的答案将适合您的情况。 you could use multiple lookbehind assertions: 您可以使用多个后向断言:

(?<!http:)(?<!https:)(?<!ftp:)//

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM