static SGFProperty fromString(StringBuffer sgf)
    throws IncorrectFormatException {

        /* Remove leading whitespace */
        if (!Character.isUpperCase(sgf.charAt(0))) {
            throw new IncorrectFormatException();
        }

        String propIdent = String.valueOf(sgf.charAt(0));
        sgf.deleteCharAt(0);
        while (Character.isUpperCase(sgf.charAt(0))) {
            propIdent += String.valueOf(sgf.charAt(0));
            sgf.deleteCharAt(0);
        }

        if (!(sgf.charAt(0) == '[')) {
            throw new IncorrectFormatException();
        }

        SGFProperty property = new SGFProperty(propIdent);


        while (sgf.charAt(0) == '[') {
            sgf.deleteCharAt(0);
            String propValue = "";
            boolean escape = false;
            while (!escape && !(sgf.charAt(0) == ']')) {
                escape = false;
                char nextChar = sgf.charAt(0);
                sgf.deleteCharAt(0);

                if (nextChar == '\\') {
                    escape = true;
                } else {
                    propValue += String.valueOf(nextChar);
                }
            }
            sgf.deleteCharAt(0);
            property.addValue(propValue);

            /* Remove leading whitespace */
            while (Character.isWhitespace(sgf.charAt(0))) {
                sgf.deleteCharAt(0);
            }
        }

        return property;
    }