崇高的搜索,其中过滤器表达式 - AND(?) 而不是 OR(,) [英] Sublime search, where filter expression - AND(?) instead of OR(,)

查看:25
本文介绍了崇高的搜索,其中过滤器表达式 - AND(?) 而不是 OR(,)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想弄清楚如何在只包含某个扩展名的文件和某个目录中进行搜索.我试过 */app/*,*.jade,但这似乎在应用目录 OR 中搜索 anything其扩展名为 .jade 的目录.我只需要一种方法来过滤满足两个条件的文件.我觉得明显的解决方案只是用 AND 字符代替逗号(它似乎充当 OR),但我不确定语法是否包含这样的功能.任何人都知道它是否可以,或者可以为我的用例提供替代解决方案吗?谢谢.

I'm trying to figure out how to search within files containing only a certain extension and within a certain directory. I've tried */app/*,*.jade, but that seems to search for anything within the app directory OR in any other directory given its extension is .jade. I just need a method to filter for files that satisfy both conditions. I feel like the obvious solution would simply be an AND character in place of the comma (which seems to act as an OR), but I'm not sure if the syntax incorporates such a feature. Anyone know if it does, or can offer an alternative solution for my use case? Thanks.

推荐答案

在文件中查找 功能允许您提供逗号分隔的搜索词列表,它们实际上是一个OR 操作.

You are indeed correct that the Find in Files functionality allows you to provide a comma separated list of search terms and they are effectively an OR operation.

请注意,您还可以使用 - 为术语添加前缀,使其表示 BUT NOT,您可以使用它来过滤结果.

Note that you can also prefix a term with - to make it mean BUT NOT, which you can use to filter results out.

为了在特定路径中只找到特定扩展名AND的文件,您需要创建一个同时包含它们的搜索词:

In order to find only files of a certain extension AND in a certain path, you need to create a search term that includes both of them at the same time:

*/app/*.jade

这篇关于崇高的搜索,其中过滤器表达式 - AND(?) 而不是 OR(,)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆