多行查找在 Visual Studio 中替换 [英] Multiline Find & Replace in Visual Studio

查看:54
本文介绍了多行查找在 Visual Studio 中替换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

能做到吗?我们使用的是 VS2005、VS2008 和 VS2010.

Can it be done? We're using VS2005 and VS2008 and VS2010.

我的意思不是正则表达式——它们有自己的位置——而是纯旧的文本 find &代替.我知道我们可以通过使用 标签的正则表达式(在紧要关头)做到这一点,但不想被正则表达式转义字符纠缠在一起,另外还有一个可读性问题.

I don't mean regular expressions - which have their place - but plain old text find & replace. I know we can do it (at a pinch) with regular expressions using the tag but prefer not to get tangled up in regex escape characters, plus there's a readability issue.

如果无法完成,人们使用什么简单(免费)的替代方法?这不涉及调用我们自己的宏.

If it can't be done what plain and simple (free) alternative are people using? That doesn't involve knocking up our own macro.

推荐答案

我终于找到了..

无需下载和加载任何外部宏.

No need to download and load any external macro.

它至少可以在带有内置宏的 Visual Studio 2008 中工作.:)

Its working in Visual Studio 2008 with in-built macro at least. :)

步骤:
1) 选择要查找的文本.
2) 按Alt+F8"或打开工具 -> 宏 -> 宏资源管理器"
3) 双击示例-> 实用程序-> FindLine".(它将打开查找"框,在查找"字段中加载您的选择.不要担心查找"字段中显示的截断文本.相信我,字段拥有一切..显示它的 MS 方式可能是......:) )
4) 单击查找和替换"对话框中的快速替换"按钮.输入您的替换文本.
5) 然后根据您的要求单击 3 个按钮中的任何一个...就完成了.:)

Steps :
1) Select text you want to find.
2) Press "Alt+F8" or open "Tools -> Macros -> Macro Explorer"
3) Double click "Sample -> Utilities -> FindLine". (It will open Find box with your selection loaded in "Find" field. Don't worry about truncated text shown in "Find" field. Trust me, field has it all..MS way of showing it may be... :) )
4) Click on "Quick Replace" button on "Find And Replace" dialog box. Enter your replace with text.
5) And Click any of 3 buttons as per your requirement...and its done. :)

万岁..它的工作..可能不是一个直接的方法,但你知道MS..没有什么是直接和容易的..:)

Hurray.. its working.. May not be a straight forward way to do it but you know with MS.. nothing is straightforward and easy.. :)

这篇关于多行查找在 Visual Studio 中替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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