日期:2014-05-20 浏览次数:20631 次
String str = "V,20120202,235900,59651,P,00998, 0, 4, 6.3408, 6.1846, 0.1562,19675, 9.08124,Km, 0.142276,PPP"; Pattern p = Pattern.compile("[^,]+,\\s*([^,]+),\\s*([^,]+)(,[^,]+){9},\\s*([^,]+).*"); Matcher m = p.matcher(str); if(m.matches()) { System.out.println(m.group(1)); System.out.println(m.group(2)); System.out.println(m.group(4)); }