I am reading from a file, and copying the double values within it into an array.
String regEx = "\\s(\\d,??\\d??)";
line = scanner.nextLine();
pattern = Pattern.compile(regEx);
matcher = pattern.matcher(line);
if(matcher.find()) {
System.out.println(matcher.group(1));
grades[i++] = Double.parseDouble(matcher.group(1));
}
But this only seems to copy the whole number part from the file, not the part after the ".", the fraction. It appears to completely ignore the part of the regex that is quantified by "??". I assume it is a problem with my regex, I cannot figure out what is wrong tho-