I'm trying to do some basic regex Quick Replace operations in Visual Studio 2010, but when I use regex grouping I don't get Tagged Expressions (ie. \1 \2 etc.) returning their values, instead they are blank.

For example:

Text

int a = int.Parse("10");
int b = int.Parse("20");
int c = int.Parse("30");

Search Pattern (regex enabled)

int\.Parse\("([0-9]*)"\);

Replace

\1;

Replaced Text

int a = ;
int b = ;
int c = ;
link|improve this question

feedback

1 Answer

up vote 2 down vote accepted

(, ) don't create a tag in Visual Studio, its regular expressions use {,} for its tagging. Use this are you search pattern:

int\.Parse\("{[0-9]*}"\);
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.