refactor: avoid polynomial regex pattern in FilenamePatternExtractor (#2770)

This commit is contained in:
James Ward
2026-09-26 16:13:38 -04:00
committed by GitHub
parent a8b1c85931
commit 16a71a8be8
@@ -56,7 +56,7 @@ public class FilenamePatternExtractor {
Map.entry("ASIN", new PlaceholderConfig("(B[A-Za-z0-9]{9}|\\d{9}[0-9Xx])", "asin"))
);
private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("\\{(\\w+)(?::(.*?))?}|\\*");
private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("\\{(\\w+)(?::([^{}]*))?}|\\*");
private static final Pattern FOUR_DIGIT_YEAR_PATTERN = Pattern.compile("\\d{4}");
private static final Pattern TWO_DIGIT_YEAR_PATTERN = Pattern.compile("\\d{2}");