From: Roland Haeder Date: Mon, 31 Aug 2015 09:24:59 +0000 (+0200) Subject: Also allow upper-case characters X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b0065783dae6fe1e0dbd0de151f15621018925c5;p=jcore.git Also allow upper-case characters Signed-off-by:Roland Häder --- 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