写法

2019-01-05

        Pattern p1 = Pattern.compile("ftp://(.*):(.*)@(.*):(.*)/(.*)");
        Matcher m1 = p1.matcher("ftp://ftp_cp2:[email protected]:39/20190104111331597.xml");
        if(m1.find()) {
            for(int i=0;i<5;i++) {
                System.out.println(m1.group(i+1));
            }
        }

点评:开发效率很高,估计执行效率不高。只要不是高并发,还是不错的代码。

猜你喜欢

转载自www.cnblogs.com/angelshelter/p/10226524.html