@Override
  public void validate(UDFParameterValidator validator) throws Exception {
    validator
        .validateInputSeriesNumber(1)
        .validateInputSeriesDataType(0, Type.TEXT)
        .validate(
            regex -> ((String) regex).length() > 0,
            "regexp has to be a valid regular expression.",
            validator.getParameters().getStringOrDefault("regex", ""))
        .validate(
            index -> (int) index >= -1,
            "index must a non-negative integer to fetch split results or -1 to get length.",
            validator.getParameters().getIntOrDefault("index", -1));
  }
This function splits string from an input series according to given regex.
library-udf/src/main/java/org/apache/iotdb/library/string/UDTFRegexSplit.java