如何在phpstorm搜索中设置文件名掩码以排除刀片文件

发布于 2025-01-23 05:17:43 字数 739 浏览 0 评论 0原文

在我的常规Laravel项目中,我有常规的.php带有类的文件和.blade.php我项目模板的文件。在使用文件掩码上搜索phpstorm时,我可以选择使用*。blade.php过滤以仅查看我的刀片模板。但是,当我用*。php过滤时,我会找到.php文件和.blade.php文件,因为这两个文件类型都以类似的方式结束。我想以一种仅找到.php文件的方式过滤,从而以某种方式排除刀片文件。

在phpstorm文档中,我找到了以下相关部分: https://www.jetbrains.com/help/phpstorm/finding-and-replacing-replacing-text-in-project.html#exclude_type 但是,本文档并未明确指定如何以这种方式排除文件。

实现这一目标的正确语法是什么?

(在撰写本文时,尚未提出过stackoverflow问题,但该特定的php/blade文件蒙版用例。)

In my regular Laravel project I have both regular .php files with classes and .blade.php files for the templates of my project. When searching in PHPStorm with a file mask on, I have the option to filter with *.blade.php to only see my blade templates. But when I filter with *.php I find both .php files and .blade.php files because both file types end in a similar way. I would like to filter in such a way that only .php files are found, thus excluding Blade files in some way.

In the PHPStorm documentation I found the following relevant section: https://www.jetbrains.com/help/phpstorm/finding-and-replacing-text-in-project.html#exclude_type
However, this documentation does not explicitly specify how to exclude files in this way.

What is the correct syntax to make this happen?

(As of this writing, no Stackoverflow questions have been asked yet featuring this specific php/blade file mask use-case.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

来世叙缘 2025-01-30 05:17:43

正确的语法如下:

*.php,!*.blade.php

说明:

  • 逗号分隔文件类型。
  • 感叹号否定/排除特定结果

您可以在此处找到有关可用通配符的更多信息:

https://www.scootersoftware.com/v4help/index.html?file_masks.s.html

通配符

通配符允许文件掩码匹配多个文件夹或文件名。

  • ?匹配任何单个字符。
  • *匹配零或任何其他数量的字符。
  • [az]匹配集合中的任何单个字符(a或z)。
  • [az]匹配范围内的任何单个字符(从A到Z)。
  • [!az]与集合中的任何单个字符匹配(不是a和z)。
  • [[]匹配单个[字符。

The correct syntax is as follows:

*.php,!*.blade.php

Explanation:

  • The comma separates the file types
  • The exclamation mark negates/excludes that specific result

You can find more information on the available wildcards here: https://www.scootersoftware.com/v4help/index.html?file_masks.html

Relevant part from that link:

Wildcards

Wildcards allow a file mask to match multiple folder or file names.

  • ? Matches any single character.
  • * Matches zero or any other amount of characters.
  • [az] Matches any single character in the set (a or z).
  • [a-z] Matches any single character in the range (from a to z).
  • [!az] Matches any single character not in the set (not a and not z).
  • [[] Matches a single [ character.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文