Possible Duplicate:
Java: how to check that a string is parsable to a double?
What is the best way to check a string for numeric characters in Java?
try {
NumberFormat defForm = NumberFormat.getInstance();
Number n = defForm.parse(s);
double d = n.doubleValue();
}
catch (Exception ex) {
// Do something here...
}
Or is there a better way using REGEX?
I don't want to strip the numbers.