使用 VS Code 搜索中的“排除文件”功能,我想搜索文件夹中的任何 Javascript 文件,包括
[.js, .ts, .jsx, .tsx]
但不包括 .json
。我已经可以通过 2 个单独的搜索来实现这一点:
./theFolder/**/*.[tj]s, ./theFolder/**/*.[tj]sx
有没有一种方法可以像在正则表达式中那样只用一个方法来完成?
./theFolder/**/*.[tj]sx? // ? doesn't do that in vscode glob
另请参阅 https://code.visualstudio.com/docs/editor/glob-patterns
在撰写本文时,还没有单可选字符匹配功能。
但是您仍然可以通过使用
{}
对条件进行分组来使您正在做的事情变得不那么冗长。前任。 ./theFolder/**/*.{[tj]s,[tj]sx}
。