我需要带正则表达式的带引号的字符串 [英] I need a regular expression for quoted strings

查看:125
本文介绍了我需要带正则表达式的带引号的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近下载了一些源文件,这些文件似乎正是我的项目所需要的.唯一的问题是它仅针对ANSI构建而编写,不支持UNICODE.

我现在想将所有字符串文字从"text text"更改为_T("text text"),方法是将它们包装在_T宏中,以使其符合unicode.

我可以在Visual Studio的查找和替换"对话框中使用的正则表达式是什么,它将为我更改所有字符串?

我对正则表达式几乎一无所知,因此不胜感激.

谢谢.

I recently downloaded some source files that seem to be exactly what I need for a project of mine. The only problem is that it is written for ANSI builds only, it has no UNICODE support.

I now want to change all string literals from "text text" to _T("text text") by wrapping them in the _T macro to make them unicode compliant.

What would be the regular expression that I could use in visual studio''s ''Find and Replace'' dialog that would change all the strings for me?

I know next to nothing about regular expressions so any help would be appreciated.

Thanks.

推荐答案

尝试一下:
Try this :
search for : \".*\"

replace with : _T(\0)


常规表达式(Visual Studio) [ ^ ]说您可以使用:q进行查找和替换.
Regular Expressions (Visual Studio)[^] says you can use :q for find and replace.


这篇关于我需要带正则表达式的带引号的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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