@Override
  public void beforeStart(UDFParameters udfParameters, UDTFConfigurations udtfConfigurations)
      throws Exception {
    pattern = Pattern.compile(udfParameters.getString("regex"));
    group = udfParameters.getIntOrDefault("group", 0);
    udtfConfigurations
        .setAccessStrategy(new MappableRowByRowAccessStrategy())
        .setOutputDataType(Type.TEXT);
  }
This function matches substring according to given regex from an input series.
library-udf/src/main/java/org/apache/iotdb/library/string/UDTFRegexMatch.java