presto-main/src/main/java/io/prestosql/type/Re2JRegexp.java/Re2JRegexp/extract
class Re2JRegexp:    public Slice extract(Slice source, long groupIndex)
    {
        Matcher matcher = re2jPattern.matcher(source);
        int group = toIntExact(groupIndex);
        validateGroup(group, matcher.groupCount());

        if (!matcher.find()) {
            return null;
        }

        return matcher.group(group);
    }