public static boolean pattern(String args) {
Pattern pattern = Pattern.compile("^[-+]?(([0-9]+)([.]([0-9]+))?|([.]([0-9]+))?)$");
Matcher isNum = pattern.matcher(args);
return !isNum.matches()?false:true;
}
posted on 2022-04-06 17:17  小胡桐  阅读(22)  评论(0编辑  收藏  举报