Using the System.Text.RegularExpressions.Regex class

string zipexp = @"\d{5}((-|\s)?\d{4})?$";
string addr = "W.44th St, New York, NY 10017-0233";
Match m = Regex.Match(addr,zipexp); // Static method
Regex zipRegex = new Regex(zipexp);
m = zipRegex.Match(addr); // Use Regex Object
Console.WriteLine(m.Value); // 10017-0233
Pattern Description Example