如何在 Eclipse 中搜索文件,以便结果显示不包含搜索词的文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1149057/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I search files in Eclipse so the results shows files that do NOT contain the search term?
提问by Cambo
In Eclipse editor, if I go Search->File, I can search for files that contain my search term. What I want to do is find all of the files that DO NOTcontain my search term. Is that possible?
在 Eclipse 编辑器中,如果我转到“搜索”->“文件”,我可以搜索包含我的搜索词的文件。我想要做的是找到所有不包含我的搜索词的文件。那可能吗?
采纳答案by ymir
Try checking "regular expression" option and then input somethign like [^term] or (?!term) -- meaning of both of this is 'not term' but they are slightly different (please refer to some RegExp documentation like this).
尝试检查“正则表达式”选项,然后输入诸如 [^term] 或 (?!term) 之类的东西——这两者的含义都是“非术语”,但它们略有不同(请参阅一些像这样的RegExp 文档)。
回答by Andrejs
The simplest way imo is to use InstaSearch Eclipse pluginand type:
imo 最简单的方法是使用InstaSearch Eclipse 插件并输入:
search text -wordToExclude -anotherWordToExclude
search text -wordToExclude -anotherWordToExclude