1public bool IsAlphaNumeric(String str) 2{ 3 Regex regexAlphaNum=new Regex("[^a-zA-Z0-9]"); 4 return !regexAlphaNum.IsMatch(str); 5}