I have a long string which is of the form:

How can i extract the data between <DETAIL> and </TEXT>, note that its NOT an xml file. There is a new line after every ending. I tried the following :
Pattern pattern = Pattern.compile("<DETAIL>(.*?)</TEXT>");
Matcher matcher = pattern.matcher(string);
while (matcher.find()) {
System.out.println(matcher.group(1));
}
It gives me null values, any one can help ? Thanks in advance.