日期:2014-05-17 浏览次数:20936 次
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Linq;
using System.Text;
namespace homework1._3
{
    class Program
    {
        static void isvalidzipcode(ref int a, out string b,out string c)
        {
            a = 11111;
            b ="-CCCC";
            c = a + b;
        }
        static void Main(string[] args)
        {
            int val=0;
            string str1,str2;
            Regex reg = new Regex(@"^\d{5}-([a-zA-Z]){4}$");
            isvalidzipcode(ref val, out str1,out str2);
            Match mm = reg.Match(str2);
            Console.WriteLine("{0}", str2);
            Console.WriteLine(mm);
            Console.ReadLine();
        }
    }
}
Console.WriteLine(mm.Success)