class IndexedRegularExpressionIncludeResolver extends RegularExpressionIncludeResolver {

  @Override
  @Nullable
  public SimpleIncludeValue resolve(@NotNull File includeFolder) {
    Matcher match = LexicalIncludePaths.matchFolderToRegex(getCompiledMatchPattern(), includeFolder);
    if (!match.find()) {
      return null;
    }
    try {
      String relativeFolder = match.group("relative");
      String libraryName = myLibraryName;
      if (libraryName == null) {
        libraryName = match.group("library");
      }
      String homeFolder = match.group("home");
      String description = myKind.myDescription;
      String version = groupOrNull(match, "ndk");
      if (version != null) {
        // Convert NDK revision like 19.2.5345600 to standard NDK release name like r19c
        Revision revision = Revision.parseRevision(version);
        if (revision.getMinor() == 0) {
          // Don't show 'a' in the NDK version. It should be r20 not r20a
          description += String.format(" r%s", revision.getMajor());
        } else {
          char minor = (char)((int)'a' + revision.getMinor());
          description += String.format(" r%s%s", revision.getMajor(), minor);
        }
      }
      return new SimpleIncludeValue(myKind, description, libraryName, relativeFolder, includeFolder, new File(homeFolder));
    } catch (IllegalArgumentException e) {
      throw new RuntimeException(String.format("Pattern %s is missing a group name", myPattern), e);
    }
  }

    IndexedRegularExpressionIncludeResolver(
    @NotNull PackageType kind,
    @NotNull String pattern,
    @Nullable String libraryName);

}