摘要:
本文由广州疯狂软件java培训为你整理: 在Java中使用正则表达式返回符合正则表达式的字符串就要用到group(),group中记录了所有符合指定表达式的字符串。本文通过一段代码讲解如何使用group()。 public static void main(String[] args) { Pattern p = Pattern.compile("(\\d+,)(\\d+)"); String s = "123,456-34,345"; Matcher m = p.matcher(s); while(m.find()) { System.out.prin 阅读全文