public void validatePasswordPolicyRegexp() {
    String regexp = getPasswordPolicyRegexp();
    if (!StringUtils.isEmpty(regexp) && !regexp.equalsIgnoreCase(".*")) {
      Pattern.compile(regexp);
    }
  }
Validate password policy regexp syntax
@throws java.util.regex.PatternSyntaxException If the expression's syntax is invalid
ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java