java使用正则表达式提取方括号中内容

                           String regex = "(?<=\\[)(\\S+)(?=\\])";
                            Pattern pattern = Pattern.compile (regex);
                            Matcher matcher = pattern.matcher (destZoneCode);
                            while (matcher.find ())
                            {
                                System.out.println (matcher.group ());
                            }


你可能感兴趣的:(正规表达式)