@Override
  public Object transform(Row row) throws IOException {
    if (row.isNull(0)) {
      return null;
    }
    String origin = row.getString(0);
    Matcher matcher = pattern.matcher(origin);

    return getResult(origin, matcher);
  }
This function replaces substring according to regex parameter from an input series.
library-udf/src/main/java/org/apache/iotdb/library/string/UDTFRegexReplace.java