|
Boost Users : |
From: Tommy Li (tommycli_at_[hidden])
Date: 2006-08-03 02:21:27
Tommy Li wrote:
> I've tried matching like this:
>
> std::string input = filecontents;
> boost::regex re_paragraphs("\\n\\n");
>
> boost::sregex_token_iterator input_token_it(input.begin(), input.end(),
> re_paragraphs, -1);
> boost::sregex_token_iterator end_token_it;
>
> for( ; input_token_it != end_token_it; input_token_it++ )
> {
> output += "TOKEN FOUND"
> }
> return output;
>
> But this never works. It matches when I use a part of a word as a token.
> The problem is that it's just not matching the newlines. I've looked
> into the input's hex and there are indeed two newline chars consecutively.
>
> 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.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net