public static List<Map.Entry<Pattern, String>> parseRegexs(
            Properties properties) {
        List<Entry<String, String>> configRegex = new ArrayList<>();
        List<Entry<Pattern, String>> regexs = new ArrayList<>();

        for (String key : properties.stringPropertyNames()) {
            if (key.startsWith(S3ProxyConstants.PROPERTY_REGEX_BLOBSTORE)) {
                String propKey = key.substring(
                        S3ProxyConstants.PROPERTY_REGEX_BLOBSTORE.length() + 1);
                String value = properties.getProperty(key);

                configRegex.add(new SimpleEntry<>(propKey, value));
            }
        }

        for (Entry<String, String> entry : configRegex) {
            String key = entry.getKey();
            if (key.startsWith(
                    S3ProxyConstants.PROPERTY_REGEX_BLOBSTORE_MATCH)) {
                String regexName = key.substring(S3ProxyConstants
                        .PROPERTY_REGEX_BLOBSTORE_MATCH.length() + 1);
                String regex = entry.getValue();
                Pattern pattern = Pattern.compile(regex);

                String replace = properties.getProperty(String.join(
                        ".", S3ProxyConstants.PROPERTY_REGEX_BLOBSTORE,
                        S3ProxyConstants.PROPERTY_REGEX_BLOBSTORE_REPLACE,
                        regexName));

                checkArgument(
                        replace != null,
                        "Regex %s has no replace property associated",
                        regexName);

                logger.info(
                        "Adding new regex with name {} replaces with {} to {}",
                        regexName, regex, replace);

                regexs.add(new SimpleEntry<>(pattern, replace));
            }
        }

        return List.copyOf(regexs);
    }
This class implements a middleware to apply regex to blob names.
The regex are configured as:
s3proxy.regex-blobstore.match.&lt;regex name&gt; = &lt;regex match
expression&gt;
s3proxy.regex-blobstore.replace.&lt;regex name&gt; = &lt;regex replace
expression&gt;

You can add multiple regex, they will be applied from the beginning to the
end,
stopping as soon as the first regex matches.
src/main/java/org/gaul/s3proxy/RegexBlobStore.java