diff --git a/src/main/java/org/jabref/logic/openoffice/ReferenceMark.java b/src/main/java/org/jabref/logic/openoffice/ReferenceMark.java index a4f1bdae054..9d59e23c3b9 100644 --- a/src/main/java/org/jabref/logic/openoffice/ReferenceMark.java +++ b/src/main/java/org/jabref/logic/openoffice/ReferenceMark.java @@ -15,7 +15,7 @@ public class ReferenceMark { private static final Logger LOGGER = LoggerFactory.getLogger(ReferenceMark.class); - private static final Pattern REFERENCE_MARK_FORMAT = Pattern.compile("^((?:JABREF_\\w+ CID_\\w+(?:,\\s*)?)+)(\\s*\\w+)?$"); + private static final Pattern REFERENCE_MARK_FORMAT = Pattern.compile("^(JABREF_\\w+ CID_\\d+(?:, JABREF_\\w+ CID_\\d+)*) (\\w+)$"); private static final Pattern ENTRY_PATTERN = Pattern.compile("JABREF_(\\w+) CID_(\\w+)"); private final String name; @@ -24,7 +24,11 @@ public class ReferenceMark { private String uniqueId; /** - * @param name Format: JABREF_{citationKey} CID_{citationNumber} {uniqueId} + * @param name Allowed formats: + * Single entry: JABREF_{citationKey} CID_{citationNumber} {uniqueId} + * Group of entries: JABREF_{citationKey1} CID_{citationNumber1}, JABREF_{citationKey2} CID_{citationNumber2}, ..., JABREF_{citationKeyN} CID_{citationNumberN} {uniqueId} + * Disallowed: JABREF_{citationKey} CID_{citationNumber} (no unique ID at the end) + * Disallowed: JABREF_{citationKey1} CID_{citationNumber1} JABREF_{citationKey2} CID_{citationNumber2} {uniqueId} (no comma between entries) */ public ReferenceMark(String name) { this.name = name;