]> git.mxchange.org Git - jcore.git/commitdiff
Also allow upper-case characters
authorRoland Haeder <roland@mxchange.org>
Mon, 31 Aug 2015 09:24:59 +0000 (11:24 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 31 Aug 2015 09:24:59 +0000 (11:24 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jcore/database/backend/base64/Base64CsvDatabaseBackend.java

index 9cc676ec535535d990e026762e4aa6f31de6dca7..86e0212324b2a957f1a516398df769e384912946 100644 (file)
@@ -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<String, String> 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