/**
* 判断number(10,6) * @param dateStr * @return */ public boolean isNumJW(String num){ String regex = "^(\\d{0,4}\\.\\d{0,6})$"; //符号需要转义,纯正则为:^(\d{0,4}\.\d{0,6})$ Pattern p = Pattern.compile(regex); Matcher m = p.matcher(num); return m.matches(); }本文共 298 字,大约阅读时间需要 1 分钟。
/**
* 判断number(10,6) * @param dateStr * @return */ public boolean isNumJW(String num){ String regex = "^(\\d{0,4}\\.\\d{0,6})$"; //符号需要转义,纯正则为:^(\d{0,4}\.\d{0,6})$ Pattern p = Pattern.compile(regex); Matcher m = p.matcher(num); return m.matches(); }转载于:https://www.cnblogs.com/wuxu/p/10071316.html