相关文章推荐
1 def main(args: Array[String]): Unit = {
2         val s = "{{a61,a2,a3},{b1,b2,b3},{c1m,.,kkl,c2,c3}}"
3         val reg = Pattern.compile("\\{(\\w+?),")
4         val matcher = reg.matcher(s)
5         while (matcher.find()) {
6             println(matcher.group(1))
1     public static void main(String[] args) {
2         test t = new test();
3         String a = "a+-b+ -c+ -d -e";
4         System.out.println(a);
5         System.out.println(a.replaceAll("(-|\\+| )",","));