Here is some sample input:
<210> DW_AT_name : (indirect string, offset: 0x55): double
DW_AT_name : (indirect string, offset:
Try the next:
public static void main(String[] args) {
String text =
"<210> DW_AT_name : (indirect string, offset: 0x55): double\n" +
" DW_AT_name : (indirect string, offset: 0x24): long int\n" +
" DW_AT_name : int";
Pattern pattern = Pattern.compile("^.*DW_AT_NAME.*:\\s*([^:]+)$",
Pattern.CASE_INSENSITIVE);
Scanner sc = new Scanner(text);
while(sc.hasNextLine()) {
String line = sc.nextLine();
Matcher matcher = pattern.matcher(line);
if (matcher.matches()) {
System.out.println(matcher.replaceAll("$1"));
}
}
}
Output:
double
long int
int