验证年月日

//验证年月日  
    bool   IsValidDate(string   strIn)   {  
    return   Regex.IsMatch(strIn,@"^2\d{3}-(?:0?[1-9]|1[0-2])-(?:0?[1-9]|[1-2]\d|3[0-1])(?:0?[1-9]|1\d|2[0-3]):(?:0?[1-9]|[1-5]\d):(?:0?[1-9]|[1-5]\d)$");    
  }    
posted @ 2007-03-30 13:37  Nina  阅读(311)  评论(0编辑  收藏  举报