
3 Aug
2006
3 Aug
'06
10:14 a.m.
Tommy Li wrote:
I think I'm missing something obvious. Anyone have any idea?
By the way, I can't even match one newline char with "\\n" though they are obviously there.
Well here's a sample program that obviously shows it does work :-) #include <boost/regex.hpp> #include <iostream> int main(int,char**) { boost::regex e("\\n"); std::string s("one\ntwo\nthree"); boost::sregex_token_iterator i(s.begin(), s.end(), e, -1), j; while(i != j) { std::cout << "<" << *i << ">" << std::endl; ++i; } } which outputs: <one> <two> <three> Just as expected. John.