@Override
  public Object transform(Row row) throws IOException {
    if (row.isNull(0)) {
      return null;
    }
    Matcher matcher = pattern.matcher(row.getString(0));
    if (matcher.find() && matcher.groupCount() >= group) {
      return matcher.group(group);
    }

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