String dk = "112233661133654"; Pattern compile = Pattern.compile("1+(.)+1"); Matcher matcher = compile.matcher(dk); while (matcher.find()){ String group = matcher.group(); System.out.println(group); }
正则表达式的方法提取字符串
最新推荐文章于 2024-06-25 18:03:42 发布
String dk = "112233661133654"; Pattern compile = Pattern.compile("1+(.)+1"); Matcher matcher = compile.matcher(dk); while (matcher.find()){ String group = matcher.group(); System.out.println(group); }