fixed regex usage
This commit is contained in:
		@@ -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));
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user