TextRange (@NotNull String rawText, int start) { int end; if (rawText.charAt(start + 1) == 'u') { end = start + 2; while (rawText.charAt(end) == 'u') end++; end += 4; } else end = start + 2; return new TextRange(start, end); }