Debug.msg("Found a match");
	public static Person lookup(String number) {		if (number.equals("")) { //$NON-NLS-1$			return null;		}		Debug.msg("Looking up " + number + "..."); //$NON-NLS-1$,  //$NON-NLS-2$		URL url = null;		String data = ""; //$NON-NLS-1$		Person newPerson;		String urlstr = SEARCH_URL + number.replaceAll("\\+","%2B");		try {			url = new URL(urlstr);			if (url != null) {				URLConnection con;				try {					con = url.openConnection();					// 5 Sekunden-Timeout fr Verbindungsaufbau										con.setConnectTimeout(5000);					String header = ""; //$NON-NLS-1$					String charSet = ""; //$NON-NLS-1$					for (int i = 0;; i++) {						String headerName = con.getHeaderFieldKey(i);						String headerValue = con.getHeaderField(i);						if (headerName == null && headerValue == null) {							// No more headers							break;						}						if ("content-type".equalsIgnoreCase(headerName)) { //$NON-NLS-1$							String[] split = headerValue.split(" ", 2); //$NON-NLS-1$							for (int j = 0; j < split.length; j++) {								split[j] = split[j].replaceAll(";", ""); //$NON-NLS-1$,  //$NON-NLS-2$								if (split[j].toLowerCase().startsWith(										"charset=")) { //$NON-NLS-1$									String[] charsetSplit = split[j].split("="); //$NON-NLS-1$									charSet = charsetSplit[1];								}							}						}						header += headerName + ": " + headerValue + " | "; //$NON-NLS-1$,  //$NON-NLS-2$					}					Debug.msg("Header of dastelefonbuch.de: " + header); //$NON-NLS-1$					Debug.msg("CHARSET : " + charSet); //$NON-NLS-1$					// Get used Charset					BufferedReader d;					if (charSet.equals("")) { //$NON-NLS-1$						d = new BufferedReader(new InputStreamReader(con								.getInputStream(), "ISO-8859-1")); //$NON-NLS-1$					} else {						d = new BufferedReader(new InputStreamReader(con								.getInputStream(), charSet));					}					// Get response data					boolean flg_found_start = false;					boolean flg_found_end   = false;					String str = ""; //$NON-NLS-1$					while ((flg_found_end == false) && (null != ((str = d.readLine())))) {						// Search for starttag						if (flg_found_start == false								&& (str.indexOf("<!-- ****** Treffer Eintrge ****** -->")!=-1)) 							flg_found_start = true;						if (flg_found_start == true) {							data += str;							// Seach for endtag							if (str.indexOf("<!-- ****** Ende Treffer Eintrge ****** -->")!=-1)								flg_found_end = true;						}					}					d.close();					Debug.msg("Begin processing responce from dastelefonbuch.de");					//This just makes the debug output unreadable!					//Debug.msg("dastelefonbuch.de Webpage: " + data); //$NON-NLS-1$					Pattern p = Pattern							.compile("title=\\\"([^<]*)\\\">[^\"]*[^>]*>([^<]*)?[^\"]*.*title=\\\"([^<]*)\\\">([^-*]*)"); //$NON-NLS-1$					Matcher m = p.matcher(data);					// Get name and address					if (m.find()) {						String line1 = m.group(1).trim();						Debug.msg(3, "Pattern1: " + line1); //$NON-NLS-1$						String[] split = line1.split(" ", 2); //$NON-NLS-1$						String firstname = "", //$NON-NLS-1$								lastname = "", //$NON-NLS-1$								company = "", //$NON-NLS-1$								address = "", //$NON-NLS-1$								zipcode = "", //$NON-NLS-1$								city = ""; 	  //$NON-NLS-1$						lastname = HTMLUtil.stripEntities(split[0]);						if (split.length > 1) {							firstname = " " + HTMLUtil.stripEntities(split[1]); //$NON-NLS-1$							Debug.msg("*" + firstname + "*" //$NON-NLS-1$,  //$NON-NLS-2$									+ firstname.indexOf("  ")); //$NON-NLS-1$							if ((firstname.indexOf("  ") > -1) //$NON-NLS-1$									&& (firstname.indexOf("  u.") == -1)) { //$NON-NLS-1$								company = firstname.substring(										firstname.indexOf("  ")).trim(); //$NON-NLS-1$								firstname = firstname.substring(0,										firstname.indexOf("  ")).trim(); //$NON-NLS-1$							} else {								firstname = firstname.replaceAll("  u. ", //$NON-NLS-1$										" und "); //$NON-NLS-1$							}						}						firstname = firstname.trim();						if (m.group(2) != null) { // there is an address							String line2 = HTMLUtil.stripEntities(m.group(2).trim());							Debug.msg(3, "Pattern2: " + line2); //$NON-NLS-1$							address = line2.trim();						}						if (m.group(3) != null) { // there is a zipcity							String line3 = HTMLUtil.stripEntities(m.group(3).trim());							Debug.msg(3, "Pattern3: " + line3); //$NON-NLS-1$							String zipcity = line3.replaceAll("\t", ""); //$NON-NLS-1$							split = zipcity.split(" ", 2); //$NON-NLS-1$							if (split.length > 1) {								zipcode = split[0].trim();								city = HTMLUtil.stripEntities(split[1].trim());							} else {								city = HTMLUtil.stripEntities(split[0].trim());							}						}						//use the area code table if city isnt found						if(city.equals(""))							city = getCity(number);						Debug.msg("Firstname: " + firstname); //$NON-NLS-1$						Debug.msg("Lastname: " + lastname); //$NON-NLS-1$						Debug.msg("Company: " + company); //$NON-NLS-1$						Debug.msg("Address: " + address); //$NON-NLS-1$						Debug.msg("ZipCode: " + zipcode); //$NON-NLS-1$						Debug.msg("City: " + city); //$NON-NLS-1$						newPerson = new Person(firstname, company, lastname,								address, zipcode, city, ""); //$NON-NLS-1$						if (company.length() > 0) {							newPerson.addNumber(number, "business"); //$NON-NLS-1$						} else {							newPerson.addNumber(number, "home"); //$NON-NLS-1$						}						return newPerson;					}				} catch (IOException e1) {					Debug.err("Error while retrieving " + urlstr); //$NON-NLS-1$				}			}		} catch (MalformedURLException e) {			Debug.err("URL invalid: " + urlstr); //$NON-NLS-1$		}		//try to lookup the city in the area code table		String city = getCity(number);		newPerson = new Person("", "", "", "", "", city, "");		newPerson.addNumber(number, "home"); //$NON-NLS-1$		return newPerson;	}