From b0065783dae6fe1e0dbd0de151f15621018925c5 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 31 Aug 2015 11:24:59 +0200 Subject: [PATCH] =?utf8?q?Also=20allow=20upper-case=20characters=20Signed-?= =?utf8?q?off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../backend/base64/Base64CsvDatabaseBackend.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/org/mxchange/jcore/database/backend/base64/Base64CsvDatabaseBackend.java b/src/org/mxchange/jcore/database/backend/base64/Base64CsvDatabaseBackend.java index 9cc676e..86e0212 100644 --- a/src/org/mxchange/jcore/database/backend/base64/Base64CsvDatabaseBackend.java +++ b/src/org/mxchange/jcore/database/backend/base64/Base64CsvDatabaseBackend.java @@ -289,7 +289,7 @@ public class Base64CsvDatabaseBackend extends BaseDatabaseBackend implements Dat throw new CorruptedDatabaseFileException(this.fileName, "No \"value=bla\" found."); //NOI18N } - Pattern pattern = Pattern.compile("(key=([a-z0-9_]{1,}),value=\"([^\"]*)\";){1,}"); //NOI18N + Pattern pattern = Pattern.compile("(key=([a-zA-Z0-9_]{1,}),value=\"([^\"]*)\";){1,}"); //NOI18N Matcher matcher = pattern.matcher(line); // Debug message @@ -298,13 +298,13 @@ public class Base64CsvDatabaseBackend extends BaseDatabaseBackend implements Dat // Matches? if (!matcher.matches()) { // Corrupted file found - throw new CorruptedDatabaseFileException(this.fileName, MessageFormat.format("line {0} doesn't match regular expression.", line)); //NOI18N + throw new CorruptedDatabaseFileException(this.fileName, MessageFormat.format("line {0} does not match regular expression.", line)); //NOI18N } // Instance map Map map = new HashMap<>(line.length() / 40); - pattern = Pattern.compile("(key=([a-z0-9_]{1,}),value=\"([^\"]*)\";)"); //NOI18N + pattern = Pattern.compile("(key=([a-zA-Z0-9_]{1,}),value=\"([^\"]*)\";)"); //NOI18N matcher = pattern.matcher(line); // Init group count @@ -317,6 +317,9 @@ public class Base64CsvDatabaseBackend extends BaseDatabaseBackend implements Dat String key = matcher.group(2); String value = matcher.group(3); + // Debug log + this.getLogger().debug(MessageFormat.format("match={0},key={1},value={2}", match, key, value)); + // key must noch be empty assert ((key != null) && (!key.isEmpty())) : MessageFormat.format("key={0} is not valid", key); //NOI18N -- 2.39.5