[英]How can I perform a boolean 'AND' search in Delphi using 'Find in Files?
Now that my code is getting ever larger, a strategy to locate key code locations is more important. 现在我的代码越来越大,找到关键代码位置的策略变得更加重要。 With faster PC's now, 'Search' 'Find in Files' is quick and effective - 'Search all files in project' often does not work if you have used implicit units.
现在有了较快的PC,“搜索”“查找文件”是快速有效的-如果使用隐式单位,“搜索项目中的所有文件”通常不起作用。 I've struggled to understand regular expressions but presumably they would let me do a search like:
我一直在努力理解正则表达式,但想必它们会让我进行如下搜索:
one OR two 一个或两个
one AND two 一和二
All searches are required to be on the same line. 所有搜索都必须在同一行上。
This would be a great improvement on a simple keyword search. 这对简单的关键字搜索将是一个很大的改进。 Is this possible in Delphi's search?
在Delphi的搜索中有可能吗? I'm using XE, XE2 and D7 (sometimes).
我正在使用XE,XE2和D7(有时)。
The regular expression you need to search for one
or two
is 您需要搜索
one
two
的正则表达式是
one|two
The |
|
symbol means or
in regex speak. 符号表示
or
用正则表达式表示。
Searching for a file containing both one
and two
is more difficult since the search is line-oriented. 搜索包含
one
和two
文件的文件更加困难,因为搜索是面向行的。 You could search for one
and two
on the same line like this: 您可以像这样在同一行上搜索
one
和two
:
one.*two|two.*one
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.