正则表达式判断数字

                String[] sa = "1.0,2.555555555#1.,.2#0,0.#-1,0.00".split("#");
Pattern p = Pattern.compile("^[0-9]+(\\.{0,1}[0-9]{1,}){0,1}$");
Matcher m = null;
for(String s : sa){
String[] sa1 = s.split(",");
for(String s1 : sa1){
m = p.matcher(s1);
System.err.println(m.matches());
}

}

你可能感兴趣的:(正则表达式)