public static Pair<Pattern, String> compilePattern(final @NotNull String pattern) {
    try {
      return Pair.create(Pattern.compile(adaptSchemaPattern(pattern)), null);
    }
    catch (PatternSyntaxException e) {
      return Pair.create(null, e.getMessage());
    }
  }
public static Pair<Pattern, String> compilePattern(final @NotNull String pattern)