close
download boost 1.59
./bootstrap.sh
./b2
export LD_LIBRARY_PATH=/home/informix/tools/boost_1_59_0/stage/lib:$LD_LIBRARY_PATH
#include <boost/regex.hpp> #include <iostream> #include <string> int main() { std::string line; boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" ); while (std::cin) { std::getline(std::cin, line); boost::smatch matches; if (boost::regex_match(line, matches, pat)) std::cout << matches[2] << std::endl; } }
g++ --std=c++11 -I /home/informix/tools/boost_1_59_0 -L /home/informix/tools/boost_1_59_0/stage/lib -lboost_regex test1.cpp -o test1.exe
$ ./test1.exe
Subject: Hellow Re:ddddddddddd
Hellow Re:ddddddddddd
Subject: PPPPPPPPPPPPP Aw:bbbbbbbbbbbbbbbbbbbbbbbbb
PPPPPPPPPPPPP Aw:bbbbbbbbbbbbbbbbbbbbbbbbb
全站熱搜
留言列表