code: public final String replaceExpr(
          String message,
          String type
      ) {
          message = decode(message);
  
          List mapFilter = getFilter(type);
  
          if (mapFilter == null)
              return message;
  
          Iterator it = mapFilter.iterator();
  
          while (it.hasNext()) {
              Object value[] = (Object[]) it.next();
              String replacement = (String) value[0];
              List vFilter = (List) value[1];
  
              if ((vFilter.size() == 0) && (replacement.equals("[VALIDATE]"))) {
                  message = validate(
                          message,
                          type
                      );
  
                  continue;
              }
  
              for (int j = 0; j < vFilter.size(); j++) {
                  Pattern filter = (Pattern) vFilter.get(j);
                  Matcher match = filter.matcher(message);
  
                  while (match.find()) {
                      message = match.replaceAll(replacement);
                      match = filter.matcher(message);
                  }
              }
          }
  
          return message;
      }
docs: Replace the input message using the rules 'type' found in the xml
  configuration file
  
  @param message message to replace
  @param type rule type
  
  @return the replaced message