英文:
How to find multiple keywords in source file from inspect element?
问题
我目前正在学习如何使用Web开发工具。所以作为其中的一部分,我正在尝试在按下ctrl + F
后出现的搜索框中找到一些多个关键字。
我的问题是
如何同时应用多个搜索过滤器来查找。比如,如果我想在源代码中查找两个以上的关键字,最佳方法是什么。
我尝试过使用正则表达式,像这样(我相当确定语法是错误的):
'关键字1' 和 '关键字2'
也尝试过
'关键字1' | '关键字2'
也尝试过
'关键字1' 或 '关键字2'
但都没有用。我是不是漏掉了什么?我知道我们可以使用正则表达式,但我正在寻找搜索多个关键字的语法。我相当确定以前用过一次,但不记得确切的表达方式是什么。
英文:
I'm currently learning how to use web developer tools. So as a part of it I'm trying to find some multiple keywords at the search box which appears after pressing ctrl + F
My question is
How can I apply multiple search filters at a time uisng find. Like If i want to find more than 2 keywords in a source what is the best way to do it.
I've tried using regular expressions like so(I'm pretty sure syntax is wrong)
'Keyword1' & 'Keyword2'
Also tried
'Keyword1' | 'Keyword2'
Also tried
'Keyword1' or 'Keyword2'
But No use. I'm I missing anything here? I know we can use regular expressions but I'm looking for syntax to search multiple keywords. I'm pretty sure I've once used it a while ago . I don't remember exact expression to do so..
答案1
得分: 3
Using regex search, you can do: ^(?=.*foo)(?=.*bar).*$
.
英文:
Using regex search, you can do: ^(?=.*foo)(?=.*bar).*$
.
答案2
得分: 1
关键字是
keyword1|keyword2|keyword3
没有空格和引号
在我的机器上,首先我需要在搜索之前关闭正则表达式功能,然后再打开它。否则它会卡住。
英文:
The syntax is
keyword1|keyword2|keyword3
without spaces and quotations
In my machine first I needed to turn off the regex feature before searching, and than turn it on again. o.w. it got stucked
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论