如何在 TFS 代码搜索中转义搜索字符串 [英] How to escape search strings in TFS Code Search

查看:27
本文介绍了如何在 TFS 代码搜索中转义搜索字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

真的很喜欢 TFS 的新"代码搜索功能,但我无法猜测如何转义 "..

Really loving the 'new' code search feature of TFS, but I am unable to guess how to escape " an ..

我想在我的代码中找到我使用SOMESTRING"的地方.在我的代码中,但是在搜索此搜索引擎时,搜索引擎似乎将 ". 分开,以便我获得使用 SOMESTRING 的所有结果,并且包含大量结果的特定字符串.

I want to find places in my code where I am using "SOMESTRING." in my code, but when searching for this the search engine seems to strib " and . so that I get all results where SOMESTRING is used and that particular string that is a lot of results.

我尝试过使用反斜杠,例如.\"SOMESTRING.\" 但同样的事情发生了.´strlit:SOMESTRING.` 确保我只在结果中得到字符串文字,但 ´.´ 仍然被忽略.帮助 似乎没有涵盖这一点.

I have tried with backslash eg. \"SOMESTRING.\" but same thing happens. ´strlit:SOMESTRING.` insures that I only get string literals in the results but the ´.´ is still ignored. The help don't seem to cover this.

推荐答案

在代码搜索中检查了一些字符.您不能在搜索查询中使用除 *? 之外的符号字符,其中包括以下字符: ., : ;/\ ` ' " = ! # $ & + ^ | ~ < > ( ) { } [ ].搜索将忽略这些符号.

Checked for some characters in code search. You can't use the symbol characters except * and ? as part of your search query, which including below characters: . , : ; / \ ` ' " = ! # $ & + ^ | ~ < > ( ) { } [ ]. The search will simply ignore these symbols.

但是您可以使用通配符 *? 来扩大搜索范围.

But you can use wildcard characters * and ? to broaden your search.

您可以在搜索字符串中的任何位置使用通配符,除了作为简单搜索字符串或使用代码的查询中的前缀类型过滤器.例如,您不能使用诸如*RequestHandlerclass:?RequestHandler.但是,您可以在其他搜索过滤器功能中使用前缀通配符;例如,搜索查询字符串文件:*RequestHandler.cs 和 repo:?Handlers是有效的.

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.

请参阅使用通配符扩大搜索范围了解详情.

如果要准确搜索包含这些符号的字符串,可以先在代码搜索中搜索,将特定代码复制到文本编辑器(例如Notepad++),然后搜索带有符号字符的字符串.

If you want to search the strings including these symbol exactly, you can first search it in code search, the copy the specific code to text editor (eg, Notepad++), then search stings with the symbol characters.

这篇关于如何在 TFS 代码搜索中转义搜索字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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