@Override
    public @NonNull ArgumentParseResult<Duration> parse(
            final @NonNull CommandContext<C> commandContext,
            final @NonNull CommandInput commandInput
    ) {
        final String input = commandInput.readString();

        final Matcher matcher = DURATION_PATTERN.matcher(input);

        Duration duration = Duration.ofNanos(0);

        while (matcher.find()) {
            String group = matcher.group();
            String timeUnit = String.valueOf(group.charAt(group.length() - 1));
            int timeValue = Integer.parseInt(group.substring(0, group.length() - 1));
            switch (timeUnit) {
                case "d":
                    duration = duration.plusDays(timeValue);
                    break;
                case "h":
                    duration = duration.plusHours(timeValue);
                    break;
                case "m":
                    duration = duration.plusMinutes(timeValue);
                    break;
                case "s":
                    duration = duration.plusSeconds(timeValue);
                    break;
                default:
                    return ArgumentParseResult.failure(new DurationParseException(input, commandContext));
            }
        }

        if (duration.isZero()) {
            return ArgumentParseResult.failure(new DurationParseException(input, commandContext));
        }

        return ArgumentParseResult.success(duration);
    }
Matches durations in the format of: <code>2d15h7m12s</code>
cloud-core/src/main/java/org/incendo/cloud/parser/standard/DurationParser.java