Run the following function requires using support System.Text.RegularExpressions namespace.
public bool checkString(string source)
{
Regex regExp=new Regex("[~!@#$%^&*()=+[\\]{}''\";:/?.,><`|!·¥…—()\\-、;:。,》《]");
return !regExp.IsMatch(source);
}
Reproduced in: https: //www.cnblogs.com/yitian/archive/2008/09/16/1291407.html