I am studying for the Java OCP certificate. I am taking mock exams to prepare.
Example program:
public class Quetico {
public static void main(String[] args) {
Pattern p = Pattern.compile(args[0]);
Matcher m = p.matcher(args[1]);
while (m.find()) {
System.out.println(m.start() + " ");
}
System.out.println("");
}
}
the authors of the OCA/OCP Jave SE 7 Study Guide maintain that the execution:
java Quetico "\B" "^23 *$76 bc"
will produce the output
0 2 4 8
However, when I run the code from Eclipse or test it on an outside source, I get
0 2 4 5 7 10
Am I missing something here, or is it a mistake by the authors of the study guide?
I am adding the actual question from the book below for reference.