Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string testString = "22.5 + 5.5i";
- vector<double> test;
- smatch matches;
- regex regexString("((\\d*)[.](\\d*))");
- size_t sz;
- while (regex_search(testString, matches, regexString)){
- test.push_back(stod(matches[0], &sz));
- matches.empty();
- testString = matches.suffix().str();
- }
- for (auto ele : test) {
- cout << ele << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment