I would recommend the following regex ("-?\d+(\.\d+)?") to match all positive and negative numbers that can be either int/long/double/float...whatever.
private Pattern pattern = Pattern.compile("-?\\d+(\\.\\d+)?");
public boolean isNumeric(String strNum) {
if (strNum == null) {
return false;
}
return pattern.matcher(strNum).matches();
}