This code doesn't work, but it works with other expressions, like (?:[A-Za-z][A-Za-z0-9_]*).
The below expression works correctley in a regular expression tester, but it doesn't replace Hello with id in this code:
string test = "int Hello := 2 ;";
string pattern = "\b(?!int|bool)(?:[A-Za-z][A-Za-z0-9_]*)\b";
string replacement = "Id";
Regex rgx = new Regex(pattern);
string newline = rgx.Replace(test, replacement);