I tried to check if a string Name contains letters, numbers, and underscore character with the following code without success, any idea of what I miss here?
var regex = new Regex(@"^[a-zA-Z0-9]+$^\w+$");
if (regex.IsMatch(Name) )
....
in addtion when I tried with the following code, I got a parsing error
"^[a-zA-Z0-9\_]+$" - Unrecognized escape sequence \_.
Var regex = new Regex(@"^[a-zA-Z0-9\_]+$");