From 9bb4f110543b692681a1aaed456d44887720c814 Mon Sep 17 00:00:00 2001 From: Stang Date: Sat, 30 May 2020 10:21:39 +0800 Subject: [PATCH] Fix #6530 --- .../org/jabref/logic/importer/fileformat/RisImporter.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java index d22c5e8d01d..9ee8f9962c4 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java @@ -316,6 +316,12 @@ private void addDoi(Map hm, String val) { if (doi.startsWith("doi:")) { doi = doi.replaceAll("(?i)doi:", "").trim(); hm.put(StandardField.DOI, doi); + } else { + String doiRegEx = "10\\.[0-9]{4,}(?:\\.[0-9]+)*/(?:(?![\"&'])\\S)+"; + Pattern pattern = Pattern.compile(doiRegEx); + if (pattern.matcher(doi).matches()) { + hm.put(StandardField.DOI, doi); + } } } }