使用 Sublime 3 在多个文件中搜索多个字符串 [英] Search for multiple strings in several files with Sublime 3

查看:138
本文介绍了使用 Sublime 3 在多个文件中搜索多个字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用 Sublime 3 在多个文件中一次搜索单个字符串(解释为 此处).

I know how to search for a single string in several files at once with Sublime 3 (explained here).

我需要做的是在多个文件中搜索多个字符串.我试过去在文件中查找并设置:

What I need to do is to search for multiple strings in several files. I've tried going to Find in files and setting:

Field:  string1 \& string2
Where: /path_to_folder_containing_the_files_I_want_to_ search/

(其中 string1string2 是我要搜索的字符串)但这似乎不起作用.

(where string1 and string2 are the strings I want to search for) but that doesn't seem to work.

这能做到吗?

推荐答案

刚遇到这个老问题,并想我会添加我的解决方案,这可能对将来有人有用.

Just came across this old question and thought I'd add my solution, which may be useful for somebody in the future.

Sublime 支持在所有打开的文件夹中搜索并且可以使用正则表达式.因此,利用两者,您可以打开或添加所有要搜索的文件夹到项目中,并使用正则表达式搜索多个关键字.在您的情况下,它将是以下内容(确保选中正则表达式框 .* 图标):

Sublime supports searching in all open folders and can use regex. So utilizing both, you can open or add all folders you want to search in to the project and use regex to search for multiple keywords. In your case it would be the following (make sure to check the regex box .* icon):

Find: (string1|string2)
Where: <open folders>

这篇关于使用 Sublime 3 在多个文件中搜索多个字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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