In Visual Studio, I’m very curious to know the regular expression to replace:
MyLog.LogFatal("Error E20111205-1147. Custom error.\n");
with this:
MyLog.LogFatal("{0}Error E20111205-1147. Custom error.\n",TPrefix(this));
It has to work for any error number, i.e. E12345678-1234.
Update
I should have clarified my question: I want to alter my C# source code, within Visual Studio, using the “Find..Find and Replace..Quick Replace” (Ctrl-H) command. There is about 1,000 instances of this message in my C# source code tree, and it would take too long to edit it manually.
EDIT: Updated solution, complete Regex is
Starting with:
Find Expression:
Replace Expression:
You Get:
For an introduction to VS2010 Regex Find and replace, please see this blog post.