class Limiter {
        double permitsPerSecond;
        long warmupPeriod;
    }

    public static Limiter match(String expression) {<FILL_FUNCTION_BODY>

        Matcher matcher = EXP_PATTERN.matcher(expression);
        if (!matcher.matches()) {
            return null;
        }
        int count = Integer.parseInt(matcher.group(1));
        String period = matcher.group(2);
        String unit = matcher.group(3);
        String mode = matcher.group(4);
        if (!TIME_TO_SECONDS.containsKey(unit)) {
            return null;
        }
        if (null == period || period.isEmpty()) {
            period = "1";
        }

        Limiter limiter = new Limiter();
        if (null != mode && !mode.isEmpty()) {
            limiter.permitsPerSecond = count;
            limiter.warmupPeriod = TIME_TO_SECONDS.get(unit).multiply(new BigDecimal(period)).longValue();
        } else {
            limiter.permitsPerSecond = new BigDecimal(count).divide(TIME_TO_SECONDS.get(unit), RoundingMode.HALF_DOWN).doubleValue();
        }
        return limiter;
    
<no_super_class>