日期:2014-05-20 浏览次数:20726 次
BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); Pattern p = Pattern.compile("[\\d\\.]*"); String s; while((s = r.readLine())!= null){ Matcher m = p.matcher(s); System.out.println(m.matches()?"match":"not match"); System.out.println(" "); }
------解决方案--------------------