Java Utililty Methods Regex Number Validate

List of utility methods to do Regex Number Validate

Description

The list of methods to do Regex Number Validate are organized into topic(s).

Method

booleanisNumber(String str)
is Number
if (str == null) {
    return true;
String regExp = "^(-|\\+)?\\d+(\\.\\d+)?$";
Pattern pattern = Pattern.compile(regExp);
return pattern.matcher(str).matches();
booleanisNumber(String str)
is Number
java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("[0-9]*");
java.util.regex.Matcher match = pattern.matcher(str);
return match.matches();
booleanisNumber(String str)
is Number
if (isEmpty(str)) {
    return false;
Matcher matcher = numberPattern.matcher(str);
return matcher.matches();
booleanisNumber(String str)
is Number
boolean bool = false;
String regex = "[0-9]*";
bool = check(str, regex);
return bool;
booleanisNumber(String str, String sign)
is Number
String regex = "";
if ("+".equals(sign)) {
    regex = "^[+]?[0-9]*$";
} else if ("-".equals(sign)) {
    regex = "^[-][0-9]*$";
} else {
    regex = "^[+-]?[0-9]*$";
return match(regex, str);
booleanisNumber(String value)
Check if the value is a digit
return Pattern.matches("[0-9].*", value);
booleanisNumber(String value)
is Number
return isDouble(value) || isInteger(value);
booleanisNumber(String value)
is Number
return isEmpty(value) ? false : NUMBER_PATTERN.matcher(value).matches();
booleanisNumber_Lowerletter_Underline(String str)
is Numbe Lowerlette Underline
boolean flag = false;
Pattern p = Pattern.compile("[A-Z0-9]*");
;
Matcher m = p.matcher(str);
;
flag = m.matches();
return flag;
booleanisNumberForLength(String numStr, int length)
is Number For Length
String regex = "[0-9]{" + length + "}";
return numStr != null && Pattern.matches(regex, numStr);