the easiest way to do this is using regex.
In java it should be something like this.
matcher.group(1) should be what you are looking for.
This code is untested, to learn more about regex I use this site : https://regex101.com/
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Example {
public static void main(String[] args) {
final String regex = "\\[(.*?)\\]";
final String string = "[Something-26543] Done some quite heavy job here.";
final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
final Matcher matcher = pattern.matcher(string);
while (matcher.find()) {
System.out.println("Full match: " + matcher.group(0));
for (int i = 1; i <= matcher.groupCount(); i++) {
System.out.println("Group " + i + ": " + matcher.group(i));
}
}
}
}