Eclipse:在Eclipse IDE下仅搜索特定单词 [英] Eclipse : search for only a particular word under Eclipse IDE
问题描述
是否可以在Eclipse IDE下仅搜索特定单词.例如,我需要搜索单词"sub".
Is it possible to search for only a particular word under Eclipse IDE . For example i need to search for a word "sub" .
但是问题是,当我输入ctr l + H并键入单词"sub"时,它会产生所有匹配的结果,例如提交---- etc,但我想在搜索中输入确切的单词"sub".
But the problem is that , when i did ctr l + H and typed the word "sub" , it producing all matching results such as submit ----etc , but i want the exact word "sub" in my Search .
请让我知道是否可能??
Please let me know if its possible ??
谢谢.
推荐答案
尝试在文件搜索"对话框(Ctrl + H)中使用正则表达式.您可以像这样使用单词边界
修饰符 \ b
:
Try using regular expressions in the File Search Dialogue (Ctrl + H). You can use the word boundaries
modifier \b
like so :
\ bsub \ b
要求Eclipse搜索所有匹配项,在这些匹配项中,sub前后都带有单词边界.在 此处 中了解更多信息.
\bsub\b
asks eclipse to search for all matches in which sub is both followed and preceded by a word boundary. Read more about word boundaries here.
以下是使用上述内容的搜索结果的示例快照:
Here is a sample snapshot of the Search Results using the above:
如果要限制搜索到当前项目,请尝试选择封闭项目"单选选项.如果您尚未从项目"中打开文件,则将禁用此选项.为了克服这种烦恼,我建议仅使用感兴趣的项目创建一个工作集,然后限制对该工作集的搜索.
If you want to restrict the search to the current project then try selecting 'Enclosing Projects' radio option. This option will be disabled if you don't already have a file from the Project opened. To get past this annoyance, I would recommend creating a Working Set with just the project(s) of interest and then restricting the search on that Working Set.
这篇关于Eclipse:在Eclipse IDE下仅搜索特定单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!