List<Integer> (@NotNull CharSequence content) { List<Integer> offsets = new ArrayList<>(); Matcher m = Pattern.compile("/\\*typehere\\*/").matcher(content); while (m.find()) { offsets.add(m.end()); } offsets.sort(Comparator.reverseOrder()); return offsets; }