http://www.iteye.com/topic/301465
补充:
判定是否符合规则
String reg = "[0-9]{1,2}\\.[0-9]{1,2}";
Pattern pattern = Pattern.compile(reg);
Matcher matcher = pattern.matcher(proxyRate);
boolean flag = matcher.matches();
本文介绍了一种使用Java正则表达式来验证特定格式数值的方法。通过定义一个正则表达式,该表达式匹配1到2位小数的数字,然后利用Pattern和Matcher类来进行匹配检查。
1165

被折叠的 条评论
为什么被折叠?



