From 373c51f0b845334c8f4c61e0e1cc7e75921e9fb6 Mon Sep 17 00:00:00 2001 From: leca Date: Sat, 14 Jun 2025 13:02:02 +0300 Subject: [PATCH] fixed regex usage --- utils/utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/utils.cpp b/utils/utils.cpp index e215a6c..42fbe42 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("<\\/?b>"); + boost::regex b_regex("()|()"); 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::regex_constants::match_all); + boost::erase_all_regex(found, b_regex); found = boost::regex_replace(found, boost::regex(" "), "?"); parsed.push_back(from_utf8(found)); }