Here you can find the source of isNumeric(String str)
private static boolean isNumeric(String str)
//package com.java2s; //License from project: Apache License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static final Pattern pattern = Pattern.compile("[\\+\\-]?[\\d]+([\\.][\\d]*)?([Ee][+-]?[\\d]+)?$"); private static boolean isNumeric(String str) { Matcher isNum = pattern.matcher(str); if (!isNum.matches()) { return false; }// w ww.java 2 s . c o m return true; } }