numberCharLength method
Calculates the number of numeric characters in the given value.
Parameters:
value
The string to be evaluated.
Returns:
The count of numeric characters in the string.
Implementation
int numberCharLength(String value) {
return regex.allMatches(value).length;
}