int (@NotNull CharSequence chars, int startOffset, int endOffset) { @SuppressWarnings("HttpUrlsUsage") final String[] URL_PREFIX = { "http://", "https://", "ftp://"}; for (String urlPrefix : URL_PREFIX) { int urlOffset = CharArrayUtil.indexOf(chars, urlPrefix, startOffset, endOffset); if (urlOffset >= 0) { return urlOffset; } } return -1; }