@Override
  public Object transform(Row row) throws IOException {
    if (row.isNull(0)) {
      return null;
    }
    String str = row.getString(0);
    String[] splitResult = str.split(regex);

    if (index == -1) {
      return splitResult.length;
    } else {
      if (index < splitResult.length) {
        return splitResult[index];
      }

      return null;
    }
  }
This function splits string from an input series according to given regex.
library-udf/src/main/java/org/apache/iotdb/library/string/UDTFRegexSplit.java