String extract(String line, String key) {

	//	System.err.println("line in extract |" + line + "|");
	line = line.replace('\'', '\"');  // some sites use ' instead of "
	//	System.err.println("line in extract after replace |" + line + "|");
	try {
	    key = key.toLowerCase();
	    String lower_case = line.toLowerCase();
	    int i = lower_case.indexOf(key);
	    if (i < 0) return null;
	    i += key.length();
	    if (line.charAt(i) != '=') return null;
	    i++;
	    int i2;
	    if (line.charAt(i) == '"') {
		i++;
		i2 = line.indexOf('"', i);
		if (i2 < 0) {
		    return line.substring(i);
		} else {
		    return line.substring(i, i2);
		}
	    } else {
		int targ = line.length();
		for (i2 = i; i < targ; i++) {
		    if (Character.isWhitespace(line.charAt(i))) break;
		}
		return line.substring(i, i2); 
	    }
	} catch (StringIndexOutOfBoundsException e) {}
	return null;
    }