I am trying to use a TextField for an input, then use only the numbers in the String.
My code looks like:
String weightTotal = findTextField(c).getText();
Matcher m = Pattern.compile("(?!=\\d\\.\\d\\.)([\\d.]+)").matcher(weightTotal);
while (m.find()) {
double d = Double.parseDouble(m.group(1));
bags.setWeightTotal(d);
}
But for some reason when it comes to compiling i am told "error: package java.util.regex does not exist
import java.util.regex.Matcher;" even tho i have in imported