code: public static String maskRegex(String input, String key, String name) {
          Map<String, Object> regexConfig = (Map<String, Object>) config.get(MASK_TYPE_REGEX);
          if (regexConfig != null) {
              Map<String, Object> keyConfig = (Map<String, Object>) regexConfig.get(key);
              if (keyConfig != null) {
                  String regex = (String) keyConfig.get(name);
                  if (regex != null && regex.length() > 0) {
                      return replaceWithMask(input, MASK_REPLACEMENT_CHAR.charAt(0), regex);
                  }
              }
          }
          return input;
      }
docs: Replace a string input with a pattern found in regex section with key as index. Usually,
  it is used to replace header, query parameter, uri parameter to same length of stars(*)
  
  @param input String The source of the string that needs to be masked
  @param key   String The key maps to a list of name to pattern pair
  @param name  String The name of the pattern in the key list
  @return String Masked result