fixed regex usage

This commit is contained in:
leca 2025-06-14 13:02:02 +03:00
parent 91ca01b255
commit 373c51f0b8
1 changed files with 2 additions and 2 deletions

View File

@ -215,13 +215,13 @@ std::vector<std::wstring> find_in_html(std::string& html, std::string regex) {
std::vector<std::wstring> find_products_in_html(std::string html) {
boost::regex search_regex("(?<=\\n\\s{20}<div class=\"ifw-col ifw-col-1 text-left\">).{0,100}(?=(<\\/b>)?<\\/div>)");
boost::regex b_regex("<\\/?b>");
boost::regex b_regex("(<b>)|(</b>)");
std::vector<std::wstring> 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("&nbsp;"), "?");
parsed.push_back(from_utf8(found));
}