Generation

generate functionTue, 01 Aug 2023

regex pattern extract the opti-id <novel-li opti-id="aaa">

std::string str = "<novel-li opti-id=\"aaa\">"; std::smatch result; std::regex re("opti-id=\"(.*?)\""); while (std::regex_search(str, result, re)) { for (auto x : result) std::cout << x << " "; std::cout << std::endl; str = result.suffix(); }

Questions about programming?Chat with your personal AI assistant