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

 

arrow
arrow
    全站熱搜

    hedgezzz 發表在 痞客邦 留言(0) 人氣()