List<Substring> (@NotNull Substring line) { final List<Substring> parts = line.split(SPHINX_REFERENCE_RE); if (parts.size() > 1) { for (Substring part : parts) { final int i = part.indexOf(":"); if (i >= 0) { final Substring beforeColon = new Substring(line.getSuperString(), line.getStartOffset(), part.getStartOffset() + i); final Substring afterColon = new Substring(line.getSuperString(), part.getStartOffset() + i + 1, line.getEndOffset()); return Arrays.asList(beforeColon, afterColon); } } return Collections.singletonList(line); } return line.split(":", 1); }