I have the following scenario:
string source1 "ABC?XYZ";
string source2 "DEF?PQR";
string replacement = "123"
string result = Regex.Replace(source1, @"([A-Z]{3,})(\?+)([A-Z]{3,})", "$1" + replacement + "$3");
The problem is of course, that the replacement string expands to "S1123$3" which confuses the parser as it tries to find $1123.
Can anyone tell me how the elements can be delimited from the replacement string?
Thanks.