private static void addCardList(ListIterator<String> lineIterator, Deck d) {
        String line;

        Pattern p = Pattern.compile("\\s*((\\d+)\\s+)?(.*?)\\s*");

        //readDeck main deck
        while (lineIterator.hasNext() && !(line = lineIterator.next()).equals("[sideboard]")) {
            Matcher m = p.matcher(line);
            m.matches();
            String s = m.group(2);
            int count = s == null ? 1 : parseInt(s);

            for (int i = 0; i < count; i++) {
                d.addMain(m.group(3));
            }
        }

        //readDeck sideboard
        while (lineIterator.hasNext()) {
            line = lineIterator.next();
            Matcher m = p.matcher(line);
            m.matches();
            String s = m.group(2);
            int count = s == null ? 1 : parseInt(s);
            for (int i = 0; i < count; i++) {
                d.addSideboard(m.group(3));
            }
        }
    }