/* Check if the formulary list needs to be converted to generic names */ if (conversion == 1) { for (String it : drugs) { String[] temparray = it.split("," + " "); for (String it_two : formularies) { Pattern pattern = null; Matcher matcher = null; pattern = Pattern.compile("\\b" + Pattern.quote(it_two) + "\\b"); matcher = pattern.matcher(temparray[0]); if (matcher.find()) { formularies_generic.add(temparray[1]); } } } for (String it : formularies_generic) { formularies.add(it); } }