Hi I am using c#.NET. I have created a regex validator to check for special characters means I donot want any special characters in username. The following is the code
Regex objAlphaPattern = new Regex(@"[[email protected]]");
bool sts = objAlphaPattern.IsMatch(username);
If I provide username as $%^&*asghf then the validator gives as invalid data format which is the result I want but If I provide a data [email protected]^&*()%^$# then my validator should block the data but my validator allows the data which is wrong
So how to not allow any special characters except a-z A-A 0-9 _ @ .-
Thanks Sunil Kumar Sahoo