From 913c91564678413d2c1c1b89cef869e5d4a132de Mon Sep 17 00:00:00 2001 From: Russ Poetker Date: Thu, 19 Dec 2024 13:59:25 -0500 Subject: [PATCH] Add size restriction to regex group --- .../deposit/service/NihmsReceiveMailService.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/service/NihmsReceiveMailService.java b/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/service/NihmsReceiveMailService.java index c0c644e1..062fb51d 100644 --- a/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/service/NihmsReceiveMailService.java +++ b/pass-deposit-services/deposit-core/src/main/java/org/eclipse/pass/deposit/service/NihmsReceiveMailService.java @@ -77,18 +77,18 @@ public NihmsReceiveMailService(PassClient passClient, } private final List depositFailurePatterns = List.of( - Pattern.compile("package id=(.*) failed because.*", Pattern.CASE_INSENSITIVE), - Pattern.compile("package id=(.*) was not submitted.*", Pattern.CASE_INSENSITIVE), - Pattern.compile("package id=(.*) is corrupt.*", Pattern.CASE_INSENSITIVE), - Pattern.compile("package id=(.*) was already used for Manuscript.*submission not created.*", + Pattern.compile("package id=(\\S{1,75}) failed because.*", Pattern.CASE_INSENSITIVE), + Pattern.compile("package id=(\\S{1,75}) was not submitted.*", Pattern.CASE_INSENSITIVE), + Pattern.compile("package id=(\\S{1,75}) is corrupt.*", Pattern.CASE_INSENSITIVE), + Pattern.compile("package id=(\\S{1,75}) was already used for Manuscript.*submission not created.*", Pattern.CASE_INSENSITIVE), - Pattern.compile("package id=(.*) for Manuscript.*submitted with the following problem.*", + Pattern.compile("package id=(\\S{1,75}) for Manuscript.*submitted with the following problem.*", Pattern.CASE_INSENSITIVE), - Pattern.compile("package id=(.*) contains unrecognized.*", Pattern.CASE_INSENSITIVE) + Pattern.compile("package id=(\\S{1,75}) contains unrecognized.*", Pattern.CASE_INSENSITIVE) ); private final Pattern depositSuccessPattern = - Pattern.compile("package id=(.*) for Manuscript ID (.*) was submitted successfully.*", + Pattern.compile("package id=(\\S{1,75}) for Manuscript ID (\\S{1,25}) was submitted successfully.*", Pattern.CASE_INSENSITIVE); public void handleReceivedMail(MimeMessage receivedMessage) {