@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(
            group -> (int) group >= 0,
            "group index has to be a non-negative integer.",
            validator.getParameters().getIntOrDefault("group", 0));
  }
This function matches substring according to given regex from an input series.
library-udf/src/main/java/org/apache/iotdb/library/string/UDTFRegexMatch.java