소스 코드: hello-boost.cpp

#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;

}


return 0;

}



Makefile

CXX=clang++

CXXFLAGS=-I/home/dev/Dev/C++/boost

LDFLAGS=-L/home/dev/Dev/C++/boost/stage/lib

LDLIBS=-lboost_regex


all:hello-boost


clean:

rm -rf hello-boost

rm -rf *.o





저작자 표시
신고
by 흥배 2014.01.29 08:00