정규 간소화 판

3225 단어 정칙
//       

        private static Regex _emailregex = new Regex(@"[a-zA-Z0-9_\-\.]+@\w+(\.\w+)+", RegexOptions.IgnoreCase);

        //        

        private static Regex _mobileregex = new Regex("^(13|15|18)[0-9]{9}$");

        //        

        private static Regex _phoneregex = new Regex(@"^(\d{3,4}-?)?\d{7,8}$");

        //IP     

        private static Regex _ipregex = new Regex(@"^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$");

        //       

        private static Regex _dateregex = new Regex(@"(\d{4})-(\d{1,2})-(\d{1,2})");

        //  (       )     

        private static Regex _numericregex = new Regex(@"^[-]?[0-9]+(\.[0-9]+)?$");

        //         

        private static Regex _zipcoderegex = new Regex(@"^\d{6}$");

좋은 웹페이지 즐겨찾기