private static String testOnePattern(BufferedReader in) throws IOException {
        String pattern = "";
        String errors = "";
        Regex r;

        for (int n = Integer.parseInt(in.readLine().replaceAll("\\s.*", "")); n > 0; n--) {
            pattern += in.readLine() + "\r";
        } // for

        r = new Regex(pattern, threshold, punctuators);

        for (int i = 0, n = Integer.parseInt(in.readLine().replaceAll("\\s.*", "")); i < n; i++) {
            String answer;
            String mode, test;
            boolean b = false;
            
            test = in.readLine();
            mode = test.replaceFirst("\\s.*", "");
            test = test.replaceFirst("\\S+\\s+", "");
            if (mode.equals("substr")) {
                b = r.presentInSequence(test) >= 0;
            } else if (mode.equals("start")) {
                b = r.matchFromStart(test);
            } else if (mode.equals("exact")) {
                b = r.match(test);
            } else if (mode.equals("fail")) {
                b = !r.match(test);
                if (!b) {
                    errors += " " + i;
                } // if
                continue;
            } else {
                System.err.println("unknown test directive (" + mode +")!");
            } // else

            answer = in.readLine();

            if (!b || !answer.equals(r.getReplacement())) {
                errors += " " + i;
            } // if
        } // for

        return errors;
    } // testOnePattern