int (@NotNull String s, int index) { if (index < 0) return -1; if (Character.isWhitespace(s.charAt(index))) return index; index = parseUnicodeEscapeBackwards(s, index, Character::isWhitespace); if (index < 0) return -1; index--; int nBackSlashes = 1; if (index >= 0 && s.charAt(index) == '\\') { nBackSlashes++; nBackSlashes += countBackSlashes(s, index - 1); } return nBackSlashes % 2 == 0 ? -1 : index + 1; }