public static String regexReplace(String pattern, DirtyType dirtyType, String dirtyMessage, String database,
            String table, String schema) {
        if (pattern == null) {
            return null;
        }

        Map<String, String> paramMap = new HashMap<>(6);
        paramMap.put(SYSTEM_TIME_KEY, DATE_TIME_FORMAT.format(LocalDateTime.now()));
        paramMap.put(DIRTY_TYPE_KEY, dirtyType.format());
        paramMap.put(DIRTY_MESSAGE_KEY, dirtyMessage);
        paramMap.put("source.database", database);
        paramMap.put("database", database);
        paramMap.put("source.table", table);
        paramMap.put("table", table);
        if (schema != null) {
            paramMap.put("source.schema", schema);
            paramMap.put("schema", schema);
        }

        Matcher matcher = REGEX_PATTERN.matcher(pattern);
        StringBuffer sb = new StringBuffer();
        while (matcher.find()) {
            String keyText = matcher.group(1);
            String replacement = paramMap.get(keyText);
            if (replacement == null) {
                continue;
            }
            matcher.appendReplacement(sb, replacement);
        }
        matcher.appendTail(sb);
        return sb.toString();
    }
replace ${database} ${table} etc. Used in cases where jsonDynamicFormat.parse() is not usable.
inlong-sort/sort-flink/base/src/main/java/org/apache/inlong/sort/base/dirty/DirtySinkHelper.java