Last active
April 3, 2018 15:47
-
-
Save Cvetomird91/d2b5612e051e7ef5609d04d6c0c75914 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iterator> | |
#include <vector> | |
#include <string> | |
#include <fstream> | |
#include <set> | |
#include <map> | |
#include <boost/regex.hpp> | |
//std::string regex_str = R"(^Matches found.*?(?= \())"; | |
std::string regex_str = "diabetes.*?\\(octave #(\\d{1,})?\\)"; | |
const boost::regex frequency_line(regex_str, boost::regex_constants::icase); | |
int main(int argc, char* argv[]) { | |
// std::ifstream *file = new std::ifstream("frequencies"); | |
std::string str = ""; | |
boost::smatch match; | |
//for (std::string str; std::getline(*file, str);) { | |
if (boost::regex_search(str, match, frequency_line)) { | |
std::cout << str << std::endl; | |
std::cout << match[0] << std::endl; | |
std::cout << match[1] << std::endl; | |
//std::cout << match[2] << std::endl; | |
//std::cout << match[3] << std::endl; | |
} | |
//} | |
//delete file; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment