Pattern p1 = Pattern.compile("(-|[0-9])?[0-9]*(\\.?)[0-9]+"); // 非數字
Matcher m = p1.matcher(str);
boolean b = m.matches(); // matches() 尝试将整个区域与模式匹配
Pattern p1 = Pattern.compile("(-|[0-9])?[0-9]*(\\.?)[0-9]+"); // 非數字
Matcher m = p1.matcher(str);
boolean b = m.matches(); // matches() 尝试将整个区域与模式匹配