String str="hh\n1\n22\n798.809\n0.89\n";
        String regex="\\d+(?:\\.\\d+)?";
        Matcher m=Pattern.compile(regex, Pattern.MULTILINE).matcher(str);
        List<String> result=new ArrayList<String>();
        while(m.find()){
            result.add(m.group());
        }
结果为:[1,22,798.809,0.89]

相关文章:

  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2022-03-11
  • 2021-12-20
猜你喜欢
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
相关资源
相似解决方案