从字符串中找数字 string 中找digits
/*
* Method: find a integer(in string) list from a
* e.g.: input ew31s25werwrt123456
* output 31 25 123456
*/
public static List<Long> getDigit(String text) {
List<Long> digitList = new ArrayList<Long>();
Pattern p = Pattern.compile("(\\d+)");
Matcher m = p.matcher(text);
while (m.find()) {
String find = m.group(1).toString();
digitList.add(Long.valueOf(find));
}
return digitList;
}