如题.
2.代码.
public String getTestString(final String remark) { //从字符串中提取一个12位的0-9的数字. String strTemp = ""; if (null == remark) { return ""; } final Pattern p = Pattern.compile("[0-9]{12,}+"); final Matcher m = p.matcher(remark); while (m.find()) { strTemp = m.group(0); } return strTemp; }原文链接:https://www.f2er.com/regex/361048.html