Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 = ;
share|improve this question
add comment

1 Answer 1

up vote 3 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]*}"\);
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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