Pattern p = Pattern.compile("[0-9]{1,9}+|[1-9]{1,8}+.[0-9]{1,}+|0.[0-9]{1,}"); Matcher m = p.matcher("0876.99"); boolean b = m.matches(); System.out.println(b);
Pattern p = Pattern.compile("(([0][.][1-9]{1,9})|[1-9]{1,9}([.][1-9]{1,9})?)"); Matcher m = p.matcher("1.1"); boolean b = m.matches(); System.out.println(b);
try{
double d=Double.parseDouble(s);
return (d>0 && d<=999999999);
}
catch(NumberFormatException n){
return false;
}
}
Pattern p = Pattern.compile("[0-9]{1,9}+|[1-9]{1,8}+.[0-9]{1,}+|0.[0-9]{1,}");
Matcher m = p.matcher("0876.99");
boolean b = m.matches();
System.out.println(b);
Matcher m = p.matcher("1.1");
boolean b = m.matches();
System.out.println(b);