I have a situation where I want to validate whether the value passed in as a String() is a numeric v. alpha/special char value. The process that will consume this data post-validation will be expecting numeric values.
Can someone give me a hint with how to do this without using a NumberFormatException? If the Exception is encountered the only recovery necessary will be to log the data that needs to be reviewed since the data is subjective and cannot be modified at runtime based on any conditions. I could just try to catch a NFE when trying to convert the value to an integer and then log that that data needs to be eye-balled, but I was hoping to do something a little more purdy.
If I were to use the java regex uitils, would I be provided a means to eliminate all alpha and special characters?
Just looking for a thums-up/thumbs-down or a possible alternative.