public static void main(String[] args) {
String a = "[117][112][113][]";
String rgex = "\\[(.*?)]";
Pattern pattern = Pattern.compile(rgex);// 匹配的模式
Matcher m = pattern.matcher(a);
while (m.find()) {
// int i = 1;
System.out.println(m.group());
// i++;
}
System.out.println("end");
}
java正则表达式(按照指定起始字符串切割)
最新推荐文章于 2022-07-22 15:13:06 发布