presto-benchmark-driver/src/main/java/io/prestosql/benchmark/driver/RegexTemplate.java/RegexTemplate/parse
class RegexTemplate:    public Optional<Map<String, String>> parse(String value)
    {
        requireNonNull(value, "value is null");

        Matcher matcher = pattern.matcher(value);
        if (!matcher.matches()) {
            return Optional.empty();
        }

        ImmutableMap.Builder<String, String> fieldsBuilder = ImmutableMap.builder();
        for (int index = 0; index < fieldNames.size(); index++) {
            String fieldName = fieldNames.get(index);
            String fieldValue = matcher.group(index + 1);
            if (fieldValue != null) {
                fieldsBuilder.put(fieldName, fieldValue);
            }
        }

        Map<String, String> fields = fieldsBuilder.build();
        return Optional.of(fields);
    }