In this input:
hello Sam, how are you 27‏ do not worry 5
how are you  why you are not OK.ℏ and ‍
I would like to perform some conditional replacements:
"2" => "a"
"7" => "b"
"5" => "c"
I also need to exclude strings such as ‏
and  
, for which we can use this pattern: &#x\w+;
Here is what I started with. However, I don't know how to exclude the pattern.
inputstring="hello Sam, how are you 27‏ do not worry 5
how are you  why you are not OK.ℏ and ‍";
string reg = @"2!(&#x\w+;)";
Regex myRegex = new Regex(reg);
string newstring = myRegex.Replace(inputstring, "a");