Skip to content

Commit

Permalink
Add size restriction to regex group
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoet-jh committed Dec 19, 2024
1 parent 2435e12 commit ecf0234
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,18 @@ public NihmsReceiveMailService(PassClient passClient,
}

private final List<Pattern> 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) {
Expand Down

0 comments on commit ecf0234

Please sign in to comment.