如何从检查元素中查找源文件中的多个关键词?

huangapple go评论64阅读模式
英文:

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).*$.

Source: https://stackoverflow.com/a/37692545/6911703

答案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

huangapple
  • 本文由 发表于 2023年2月8日 18:28:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/75384419.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定