public bool ValidateUsername(string username) { if (!IntExtensions.IsBetween(username.Length, 1, 40)) { return(false); } if (!Regex.IsMatch(username, @"^[a-zA-Z0-9\s]")) { return(false); } return(true); }