public static String getPrice() { try { source = readUrl(webpage + text.replaceAll(" ", "+")); if(!source.contains("error")) { Pattern pattern = Pattern.compile("(?<=\"average\":\")[0-9]+"); Matcher matcher = pattern.matcher(source); while (matcher.find()) return "Average offer: " + Util.format(Integer.parseInt(matcher.group()), Util.COMMAS) + "GP"; } else { quantityAndPrice = ""; names = ""; notes = ""; return text + "\n_______________________________\n\n" + "Error retrieving data.\nThis could be due to a few reasons such as:\n" + "(1) You are not connected to the internet.\n" + "(2) Zybez.net's price guide is down.\n" + "(3) You have misspelled the item.\n"; } } catch(Exception e) {} return ""; }