Visual Studio Find and Merge with instead of Find and Replace

So, I want to surround all string literals in our C ++ source using _T (...) for our unicode port.

This question answers the question, how am I looking for string literals, but is there a way to surround the consistent text using _T () instead of replacing it with something else?

I intend to do this one line at a time anyway, but not right away, but I don’t want to enter it or use the “Surround With” from Visual Assist myself for each line.

+1
source share
2 answers

Jump to: Change | Find and replace ... | Quick Substitution .. Then enter:

Find: :q
Replace with : _T(\0)
Use: Regular Expressions
0

Jochen Kalmbach Visual Studio, Visual Studio 2013. RegEx Find/Replace :/p >

RegEx shortcut buttons are helpful for non-RegEx experts

"" ": q Quoted string". "" "$ 1". , 1, $1 _T().

:   ((\) "+ \.?" | '? +'())

:   _T ($ 1)

, $1 RegEx, .

:

:

Converter.toCustomObject($find("Anything"));

( $find()):

Converter.toDifferentObject($find("Anything"), true);

( RegEx ):

Converter\.toCustomObject\((\$find\(.*)\);

:

Converter.toDifferentObject($1, true);

, Replace , RegEx, . , :

Converter.toDifferentObject($1, true);\r\n
+1

All Articles