Created
October 4, 2013 14:30
-
-
Save sourabh86/6826862 to your computer and use it in GitHub Desktop.
main cpp file for Boost regex example
This file contains 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 <boost/regex.hpp> | |
#include <iostream> | |
#include <string> | |
int main() | |
{ | |
std::string line; | |
boost::regex pat( "^Subject: (Re: |Fw: )*(.*)" ); | |
while (std::cin) | |
{ | |
std::getline(std::cin, line); | |
boost::smatch matches; | |
if (boost::regex_match(line, matches, pat)) | |
std::cout << matches[2] << std::endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment