fixed regex usage
This commit is contained in:
parent
91ca01b255
commit
373c51f0b8
|
@ -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(" "), "?");
|
||||
parsed.push_back(from_utf8(found));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue