搜索字符串字面 [英] Searching For String Literals
问题描述
在本地化,我需要找到所有散落其中包括我们的源$ C $ c中的字符串的追求。我一直在寻找一种方式来脚本到这一点后修改源代码库检查。 (IE浏览器后有人检查的东西有一个盒子设置,可以检查这个统计),我可能会使用楠和CruiseControl的什么来处理CVS(井的StarTeam在我的情况:()的管理,但你知道任何脚本化的(或命令行)工具来准确地循环源$ C $ C寻找字符串?我知道我可以做到基于正则EX pressions简单的字符串查找,但想为我的降压多一点爆炸。(也许分析字符串或放入分类)因为有很多次的字符串可能不一定需要翻译。任何想法?
In the quest for localization I need to find all the string literals littered amongst our source code. I was looking for a way to script this into a post-modification source repository check. (I.E. after some one checks something in have a box setup to check this stat) I'll probably use NAnt and CruiseControl or something to handle the management of the CVS (Well StarTeam in my case :( ) But do you know of any scriptable (or command line) utility to accurately cycle through source code looking for string literals? I realize I could do simple string look up based on regular expressions but want a little more bang for my buck. (Maybe analyze the string or put it into categories) Because a lot of times the string may not necessarily require translation. Any ideas?
推荐答案
Visual Studio 2010和更早版本:
Visual Studio 2010 and earlier:
- 找到在文件(Ctrl + Shift + F)
- 使用:普通防爆pressions
- 找到:
:Q
(引号的字符串) - 找到所有
查找结果窗口现在将包含所有文件的报告,行号和行自身的引号的字符串。
Find Results window will now contain a report of all files, with line numbers and the line itself with the quoted string.
有关的Visual Studio 2012和以后搜索((\+ \?)|'+'())
(引用,帽尖的 @ CincauHangus )
For Visual Studio 2012 and later search for ((\".+?\")|('.+?'))
(reference, hat-tip to @CincauHangus)
这篇关于搜索字符串字面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!