如何在Sublime Text 3中搜索带有A和不带有B的文件?

问题描述

使用Sublime Text 3文件搜索功能可以搜索目录(及其所有子目录)中的文件,以查看它们是否包含字符串A_STR(或RegExp /A_STR/),但不包含包含B_STR(或RegExp /B_STR/)?

解决方法

您可以使用:

\A(?:(?!B_STR)[\s\S])*A_STR(?:(?!B_STR)[\s\S])*\z

说明:

\A                          # beginning of file
  (?:(?!B_STR)[\s\S])*      # Not B_STR,you may use use \bB_STR\b
  A_STR                     # A_STR,you may use use \bA_STR\b
  (?:(?!B_STR)[\s\S])*      # Not B_STR,you may use use \bB_STR\b
\z                          # end of file

截屏:

enter image description here

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...