public Rx makeClosingRegex(String line, Scope scope, Marker m) {
if (m.pattern instanceof DoublePattern && !m.isCloseScope) {
DoublePattern dp = (DoublePattern) m.pattern;
// System.out.printf("making closing regex: %s\n", dp.endString);
Rx rx = Rx.createRx("\\\\(\\d+)");
Match match;
int pos = 0;
StringBuilder src = new StringBuilder("");
boolean found = false;
while ((match = rx.search(dp.endString, pos, (int) dp.endString.length())) != null) {
found = true;
src.append(dp.endString.substring(pos, match.getCapture(0).start));
String numstr = dp.endString.substring(match.getCapture(1).start, match.getCapture(1).end);
int num = Integer.parseInt(numstr);
// System.out.printf("capture found: %d\n", num);