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