有没有办法让 TFS 代码搜索识别“@”符号?
Is there a way to make TFS code search recognize the "@" symbol?
我正在 TFS 的代码库中搜索所有出现的过时电子邮件域。具体来说,我正在搜索“@testexample.com”。然而,搜索似乎完全忽略了“@”符号。
如果我搜索“@testexample.com”,我会得到所有出现的 "testexample.com"。我也尝试过“*@testexample.com”,但代码搜索中不允许使用前缀通配符。
不支持。
在代码搜索中检查了一些字符。您不能使用 *
和 ?
以外的符号字符作为搜索查询的一部分,其中包括以下字符: 。 , : ; / \ ` ' " @ = !# $ & + ^ | ~ < > ( ) { } [ ]。搜索将简单地忽略这些符号。
但是您可以使用通配符 * 和 ?扩大您的搜索范围。
You can use wildcard characters anywhere in your search string except
as a prefix in a simple search string or a query that uses a code type
filter. For example, you cannot use a search query such as
*RequestHandler or class:?RequestHandler. However, you can use prefix wildcards with the other search filter functions; for example, the
search query strings file:*RequestHandler.cs and repo:?Handlers are
valid.
详情请见Broaden your search with wildcards。
如果要精确搜索包含这些符号的字符串(比如这里的'@'),可以先用代码搜索其他字符串(比如这里的testexample.com
)缩小范围,然后将具体代码复制到支持该符号的文本编辑器(如Notepad++),然后搜索带符号字符的字符串
此外,如果您使用的是 Git,另一种解决方法是使用代码搜索工具 Hound: a lightning fast code search tool, it supports the symbol characters. Reference this thread to use it: How can I publish source code (Visual Studio) on a intranet?
我正在 TFS 的代码库中搜索所有出现的过时电子邮件域。具体来说,我正在搜索“@testexample.com”。然而,搜索似乎完全忽略了“@”符号。
如果我搜索“@testexample.com”,我会得到所有出现的 "testexample.com"。我也尝试过“*@testexample.com”,但代码搜索中不允许使用前缀通配符。
不支持。
在代码搜索中检查了一些字符。您不能使用 *
和 ?
以外的符号字符作为搜索查询的一部分,其中包括以下字符: 。 , : ; / \ ` ' " @ = !# $ & + ^ | ~ < > ( ) { } [ ]。搜索将简单地忽略这些符号。
但是您可以使用通配符 * 和 ?扩大您的搜索范围。
You can use wildcard characters anywhere in your search string except as a prefix in a simple search string or a query that uses a code type filter. For example, you cannot use a search query such as *RequestHandler or class:?RequestHandler. However, you can use prefix wildcards with the other search filter functions; for example, the search query strings file:*RequestHandler.cs and repo:?Handlers are valid.
详情请见Broaden your search with wildcards。
如果要精确搜索包含这些符号的字符串(比如这里的'@'),可以先用代码搜索其他字符串(比如这里的testexample.com
)缩小范围,然后将具体代码复制到支持该符号的文本编辑器(如Notepad++),然后搜索带符号字符的字符串
此外,如果您使用的是 Git,另一种解决方法是使用代码搜索工具 Hound: a lightning fast code search tool, it supports the symbol characters. Reference this thread to use it: How can I publish source code (Visual Studio) on a intranet?