How can I change the following code so it will not care about case?
public static String tagValue(String inHTML, String tag)
throws DataNotFoundException {
String value = null;
Matcher m = null;
int count = 0;
try {
String searchFor = "<" + tag + ">(.*?)</" + tag + ">";
Pattern pattern = Pattern.compile(searchFor);
m = pattern.matcher(inHTML);
while (m.find()) {
count++;
return inHTML.substring(m.start(), m.end());
// System.out.println(inHTML.substring(m.start(), m.end()));
}
} catch (Exception e) {
throw new DataNotFoundException("Can't Find " + tag + "Tag.");
}
if (count == 0) {
throw new DataNotFoundException("Can't Find " + tag + "Tag.");
}
return inHTML.substring(m.start(), m.end());
}