java 正则匹配int型

 

 

private static Pattern DIGIT_PATTERN = Pattern.compile("=\\d++");

Matcher goodsTypeMatcher = DIGIT_PATTERN.matcher(scoreFour);
   if (goodsTypeMatcher.find()) {
      String comment = goodsTypeMatcher.group();
      generalComments+=Integer.valueOf(comment);
   }

 

posted @ 2014-11-12 11:23  RY一步一个脚印  阅读(1990)  评论(0编辑  收藏  举报