1 2public static bool IsValidUSZip(string num) 3{ 4 // Allows 5 digit, 5+4 digit and 9 digit zip codes 5 string pattern = @"^(\d{5}-\d{4}|\d{5}|\d{9})$"; 6 Regex match = new Regex(pattern); 7 return match.IsMatch(num); 8}