我需要带正则表达式的带引号的字符串 [英] I need a regular expression for quoted strings
问题描述
我最近下载了一些源文件,这些文件似乎正是我的项目所需要的.唯一的问题是它仅针对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屋!