summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--resources/token_info.txt2
-rw-r--r--src/postgresHandler.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/resources/token_info.txt b/resources/token_info.txt
index 565db7c..b238169 100644
--- a/resources/token_info.txt
+++ b/resources/token_info.txt
@@ -1 +1 @@
-EUYEPGK48vlJ2yGdmPRQkh5fYLIH6spP4M 484055 \ No newline at end of file
+EUYEPGK48vlJ2yGdmPRQkh5fYLIH6spP4M 484079 \ No newline at end of file
diff --git a/src/postgresHandler.cpp b/src/postgresHandler.cpp
index 256bf06..f5b603b 100644
--- a/src/postgresHandler.cpp
+++ b/src/postgresHandler.cpp
@@ -20,7 +20,11 @@ void display_query_result(const pqxx::result &t_r) {
void add_cards_to_database(const std::string &t_cards, pqxx::work &t_tx) {
// TODO: to complete
std::cout << "adding cards..." << std::endl;
- std::regex key_regex("\"(.*?)\":"); // TODO: write correct regex
+ std::regex key_regex(
+ "\"[^\"?]+\":([0-9]+|\"[^\"?]*\"|\\[([0-9,]*)\\]|null)"); // TODO:
+ // write
+ // correct
+ // regex
auto words_begin =
std::sregex_iterator(t_cards.begin(), t_cards.end(), key_regex);
auto words_end = std::sregex_iterator();