private static void checkRegex(@NotNull String regex) {
    try {
      Pattern.compile(regex);
    }
    catch (PatternSyntaxException e) {
      throw new MalformedPatternException(SSRBundle.message("invalid.regular.expression", e.getMessage()));
    }
  }
private static void checkRegex(@NotNull String regex)