public NodeList extractTitles(String input) throws IOException, CWRCException {
        List<Title> output = new ArrayList<Title>();

        Reader reader = new StringReader(input);
        int val = 0;
        StringBuilder builder = new StringBuilder();
        Title title = new Title();

        // First test the title against the excluded names
        for (String testTitle : excludeTitles) {
            if (StringUtils.equals(testTitle, input)) {
                title.title = input;
                output.add(title);
                return new TitleNodes(output);
            }
        }

        // Read the input.
        String bracketData;
        while ((val = reader.read()) > -1) {
            switch (val) {
                case '/':
                    title.title = builder.toString().trim();
                    output.add(title);
                    title = new Title();
                    builder.setLength(0);
                    break;

                case '(':
                    bracketData = inBracket(reader, title);
                    if (bracketData != null) {
                        builder.append("(");
                        builder.append(bracketData);
                        builder.append(")");
                    }
                    break;

                case '[':
                    output.add(readSquareBracket(reader));
                    break;

                default:
                    builder.append((char) val);
            }
        }

        title.title = builder.toString().trim();
        output.add(title);
        return new TitleNodes(output);
    }