zoukankan      html  css  js  c++  java
  • 1-65535

    public class Test {
        public static void main(String[] args) {
            String regexPort = "^((6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3}))|"
                    + "((6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3})[,])*"
                    + "(((6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3})){1})$";
            String cgiPort = "65535,,,,333";
                if(!cgiPort.matches(regexPort)){
                System.out.println("false");
                }else{
                    System.out.println("true");
                }
        }
        
    }

    思想:

    http://www.zjmainstay.cn/deep-regexp

    http://www.cnblogs.com/yrcumt2010/archive/2011/01/13/1934601.html

  • 相关阅读:
    7-11
    7-9
    7-8
    7-7
    7-6
    7-5
    7-4
    7-3
    第08次:升级《陋习手记》完善主从UI
    第07次:升级《陋习手记》显示多条数据
  • 原文地址:https://www.cnblogs.com/sj521/p/5682006.html
Copyright © 2011-2022 走看看