I need to convert expressions of the form:
return *;
into:
return filter(*);
It seems simple enough to express it with wildcards, however, in visual studio’s search & replace dailog, there’s no way to associate the first asterisk with the second one. I suppose a regex can do this quite easily, however I know very little about regexes.
How do I express this criteria in regex?
A capture group when searching/replacing with regex in VS can be given by enclosing something with curly braces.
A backreference can be given simply by using
\1. There is also a menu to the right of the input fields, containing building blocks.So you would be simply replacing
by
The
[^;]+specifies that you want at least one character that is not a semicolon, so unless you return delegates or anonymous methods this should work fine.