具体的代码实现如下:
public static boolean isInt(String string) {
if (string == null)
return false;
String regEx1 = "[\\-|\\+]?\\d+";
Pattern p;
Matcher m;
p = Pattern.compile(regEx1);
m = p.matcher(string);
if (m.matches())
return true;
else
return false;
}