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

booleanisNumberLiteral(String s)
Check whether a string resembles a valid number literal.
return isHexLiteral(s) || isBinaryLiteral(s) || isDecimalLiteral(s);
booleanisNumberOfShownValue(String inputString)
is Number Of Shown Value
String regex = "^[1-9]\\d*"; 
return getCheckValue(regex, inputString);
booleanisNumeric(String as_argument)
check if given argument is numeric.
boolean return_value = isOneMatched(sNUMERIC_PATTERNS, as_argument);
return return_value;
booleanisNumeric(String input)
is Numeric
boolean result = false;
if (input != null) {
    result = NUMERIC_PATTERN.matcher(input).matches();
return result;
booleanisNumeric(String number)
is Numeric
boolean isValid = false;
String expression = "[0-9]*";
CharSequence inputStr = number;
Pattern pattern = Pattern.compile(expression);
Matcher matcher = pattern.matcher(inputStr);
if (matcher.matches()) {
    isValid = true;
return isValid;
booleanisNumeric(String s)
Returns true if String s is numeric (i.e., the Digit POSIX character class) characters and nothing else.
if (!hasLength(s)) {
    return false;
Matcher m = DIGIT_REGEX.matcher(s);
return m.matches();
booleanisNumeric(String str)
Tests whether a given string can be converted to an integer.
return Pattern.matches("\\d+", str);
booleanisNumeric(String str)
is Numeric
Pattern pattern = Pattern.compile("\\d+\\.\\d+$|-\\d+\\.\\d+$");
Pattern pattern2 = Pattern.compile("[0-9]*");
return pattern.matcher(str).matches() || pattern2.matcher(str).matches();
booleanisNumeric(String str)
is Numeric
Pattern pattern = Pattern.compile("[0-9]*");
return pattern.matcher(str).matches();
booleanisNumeric(String str)
is Numeric
if (isNullOrEmpty(str)) {
    return false;
String NUMERIC_PATTERN = "^(-?\\d+)(\\.\\d+)?$";
Pattern pattern = Pattern.compile(NUMERIC_PATTERN);
Matcher matcher = pattern.matcher(str);
return matcher.matches();