Input-> Input!RC + Calc!R[1]C[1]
In Output I want to operate on these :
RC and R[1]C[1]
My attempt :
private static void findMatch(String formula) {
Matcher m = Pattern.compile("\\W(R(\\[(.+?)\\])?C(\\[(.+?)\\]))")
.matcher(formula);
// Matcher m = Pattern.compile(
// "\\W(R(\\[(.+?)\\])?C) | \\W(R(\\[(.+?)\\])?C(\\[(.+?)\\]))")
// .matcher(formula);
for (; m.find(); m.reset(formula)) {
System.out.println(m.group(3));
}
}
It does not look for the second pattern as well it goes into infinite loops.
Whats wrong with this ?