diff --git a/main.cpp b/main.cpp index 3ebf3d4..4389224 100644 --- a/main.cpp +++ b/main.cpp @@ -1,4 +1,3 @@ -#include "email_parser/emailparser.h" #include #include #include @@ -15,40 +14,14 @@ # include using namespace std::filesystem; #endif -#include -#include -#include -#include #ifdef BUILD_TRANSLATIONS # include #endif -#include #ifdef BUILD_EMAIL_MODE - // #include -#include +# include #endif -#include - -#include -#include int main(int argc, char *argv[]) { - // std::string path = "/tmp/html"; - // std::string content = read_file(path); - - // Check c = parseOfdRuAnswer(content); - // std::cout << - // return 0; - // EmailParser p; - // p.parse_file("/home/leca/example_email_receipts/avito.eml"); - // p.parse_file("/home/leca/example_email_receipts/читай_город.eml"); - // p.parse_file("/home/leca/example_email_receipts/lenta.eml"); - // p.parse_file("/home/leca/example_email_receipts/magnit.eml"); - // p.parse_file("/home/leca/example_email_receipts/pyaterochka.eml"); - // p.parse_file("/home/leca/example_email_receipts/rzd.eml"); - // p.parse_file("/home/leca/example_email_receipts/russteels.eml"); - // p.parse_file("/home/leca/example_email_receipts/avtodor.eml"); - // return 0; curl_global_init(CURL_GLOBAL_ALL); qRegisterMetaType("Check"); diff --git a/translations/en_US.ts b/translations/en_US.ts index 258bac2..8f0e384 100644 --- a/translations/en_US.ts +++ b/translations/en_US.ts @@ -671,7 +671,7 @@ QObject - + Using locale: Using locale: diff --git a/translations/ru_RU.ts b/translations/ru_RU.ts index 6656b9c..bff8434 100644 --- a/translations/ru_RU.ts +++ b/translations/ru_RU.ts @@ -647,7 +647,7 @@ QObject - + Using locale: Использую локаль: diff --git a/utils/utils.cpp b/utils/utils.cpp index a28e43f..e215a6c 100644 --- a/utils/utils.cpp +++ b/utils/utils.cpp @@ -215,13 +215,13 @@ std::vector find_in_html(std::string& html, std::string regex) { std::vector find_products_in_html(std::string html) { boost::regex search_regex("(?<=\\n\\s{20}
).{0,100}(?=(<\\/b>)?<\\/div>)"); - boost::regex b_regex(""); + boost::regex b_regex("<\\/?b>"); std::vector parsed; for (boost::sregex_iterator it{html.begin(), html.end(), search_regex}, end{}; it != end; it++) { std::string found = it->str(); - boost::erase_regex(found, b_regex); + boost::erase_regex(found, b_regex, boost::regex_constants::match_all); found = boost::regex_replace(found, boost::regex(" "), "?"); parsed.push_back(from_utf8(found)); }