code: public static String lookupParameterValue(String key, String string) {
  		Pattern p = Pattern.compile("\\[" + key + "=[^\\]]*\\]");
  		Matcher m = p.matcher(string);
  		m.find();
      	String f = m.group();
      	int p1 = f.indexOf('=');
      	int p2 = f.indexOf(']');
      	return f.substring(p1+1, p2);
  	}
docs: Search for patterns [key=value] and returns the value given the key.
  
  @param key
  @param string
  @return