[Xpressive] How to quantify embedded regex?

I am trying to use Xpressive for parsing string-based message buffers. The messages start with a fixed string and end with an "empty" line (similar in form to HTTP). Here is code that illustrates my problem: int main(int argc, char **argv) { std::string buffer_ = "FROGGIE\r\n" "Volume = 3\r\n" "Other1= 0\r\n" "Channel=1\r\n" "Other =2\r\n" "\r\n" "FROGGIE\r\n" "Volume = 4\r\n" "Other1= 8\r\n" "Channel=5\r\n" "Other =3\r\n" "\r\n" "FROGGIE\r\n" "Volume = 4\r\n" "Other1= 8\r\n" "Channel=5\r\n"; // mark_tag name_(1), value_(2); To be used in the name_value_pair later. sregex name_value_pair_ = +alnum >> *_s >> "=" >> *_s >> +_d >> *_s >> _ln; sregex re_ = "FROGGIE" >> _ln >> name_value_pair_ >> _ln; // sregex re_ = "FROGGIE" >> _ln >> repeat<1,5>(name_value_pair_)
_ln; // sregex re_ = "FROGGIE" >> _ln >> +(name_value_pair_) >> _ln; }
The only examples of repeating an embedded regex I could find in the .pdf or the examples subdirectory used predefined regexes like alnum but still, it looked to me that the lines that are commented out should have worked. I am clearly wrong. Both of these forms create very long error messages that end with "internal compiler error". One of those error messages is included as an attachment. The uncommented line compiles fine. Since I'm not very accomplished at regular expressions, maybe I should point out that, besides being able to extract the name/value pairs from each message in turn, I want to use what.suffix() to identify the partial message at the end of the buffer. OS is Linux Core 3 2.6.9-1.667. Compiler is gcc 3.4.2 20041017 (Red Hat 3.4.2-6fc5). Xpressive README (in the .zip) says "Last Modified: October 9, 2005". If someone could point me in the right direction, I'd surely appreciate it. If this query is not appropriate for this group, should I post it to boost-users@lists.boost.org or mail the author directly or..? Regards, Dick Bridges

BRIDGES Dick wrote:
I am trying to use Xpressive for parsing string-based message buffers. The messages start with a fixed string and end with an "empty" line (similar in form to HTTP). Here is code that illustrates my problem:
<snip> You're doing it right, and the commented out lines compile for me (with VC++ 7.1). I recently fixed a few bugs in this area, so perhaps you could give the latest version (0.9.8a from Oct 19) a shot and let me know if that works.
If this query is not appropriate for this group, should I post it to boost-users@lists.boost.org or mail the author directly or..?
Here is fine. -- Eric Niebler Boost Consulting www.boost-consulting.com
participants (2)
-
BRIDGES Dick
-
Eric Niebler