Here is the code:
var x = "Word1 Word2 @aaa|sss Word3 Word4 @aaa|sss Word5";
var s = Regex.Replace(x, "\\b@aaa|sss\\b", "55", RegexOptions.Singleline);
Expected output:
Word1 Word2 55 Word3 Word4 55 Word5
Actual:
Word1 Word2 @aaa|55 Word3 Word4 @aaa|55 Word5
I am sure, this is something silly... why?
This question is not about "special characters" as in here. This is rather not understanding where the problem is. And the question above doesn't have specific case as in here.