String (String elementText) { String textAfterMarker = elementText.replaceFirst("[/*#-]*\\s*region(.*)", "$1"); String result = elementText.startsWith("/*") ? StringUtil.trimEnd(textAfterMarker, "*/").trim() : textAfterMarker.trim(); return result.isEmpty() ? "..." : result; }