code: protected String getValidationMessage(
          CmsObject cms,
          I_CmsXmlContentValue value,
          String regex,
          String valueStr,
          boolean matchResult,
          boolean isWarning) {
  
          String message = null;
          if (isWarning) {
              message = m_validationWarningMessages.get(value.getName());
          } else {
              message = m_validationErrorMessages.get(value.getName());
          }
  
          if (message == null) {
              if (isWarning) {
                  message = MESSAGE_VALIDATION_DEFAULT_WARNING;
              } else {
                  message = MESSAGE_VALIDATION_DEFAULT_ERROR;
              }
          }
  
          // create additional macro values
          Map<String, String> additionalValues = new HashMap<String, String>();
          additionalValues.put(CmsMacroResolver.KEY_VALIDATION_VALUE, valueStr);
          additionalValues.put(CmsMacroResolver.KEY_VALIDATION_REGEX, ((!matchResult) ? "!" : "") + regex);
          additionalValues.put(CmsMacroResolver.KEY_VALIDATION_PATH, value.getPath());
  
          CmsMacroResolver resolver = CmsMacroResolver.newInstance().setCmsObject(cms).setMessages(
              getMessages(OpenCms.getWorkplaceManager().getWorkplaceLocale(cms))).setAdditionalMacros(additionalValues);
  
          return resolver.resolveMacros(message);
      }
docs: Returns the validation message to be displayed if a certain rule was violated.<p>
  
  @param cms the current users OpenCms context
  @param value the value to validate
  @param regex the rule that was violated
  @param valueStr the string value of the given value
  @param matchResult if false, the rule was negated
  @param isWarning if true, this validation indicate a warning, otherwise an error
  
  @return the validation message to be displayed