Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <boost/regex.hpp>
- #include <iostream>
- #include <string>
- int main()
- {
- std::string text("dgdr<p>55,99.5,99.6</p>svf<p>55,99.5,99.6</p>frdg");
- const char* pattern = "<p>(.*?)</p>";// [^,]+ -- seperar por virgulas
- boost::regex ip_regex(pattern);
- boost::sregex_iterator it(text.begin(), text.end(), ip_regex);
- boost::sregex_iterator end;
- for (; it != end; ++it) {
- std::cout << it->str() << "\n";
- // v.push_back(it->str()); or something similar
- }
- system("pause");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement