fork download
  1. #include <boost/algorithm/string/iter_find.hpp>
  2. #include <boost/algorithm/string/finder.hpp>
  3. #include <iostream>
  4. #include <vector>
  5. #include <string>
  6.  
  7. int main()
  8. {
  9. std::string s = "KEKA_KAWAII_2026{\"four\":\"ssss\"}";
  10. std::vector<std::string> results;
  11.  
  12. boost::iter_split(results, s, boost::first_finder("KEKA_KAWAII_2026"));
  13.  
  14. for(int index = 0; index < results.size(); ++index)
  15. {
  16. if (results[index].empty() == false)
  17. {
  18. std::cout << "item: " << results[index] << std::endl;
  19. }
  20. }
  21. }
  22.  
  23.  
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
item: {"four":"ssss"}