Boost Users :
Subject: Re: [Boost-users] regex
From: John Maddock (john_at_[hidden])
Date: 2009-12-13 11:51:35
> I have a question regarding boost::regex.
> I have one regex which should identify my string AND cut it into pieces.
> I've tried with regex_token_iterator and cmatch and failed.
How about (caution, untested, off the top of my head!):
// 1. attempt
boost::sregex_token_iterator i(s.begin(), s.end(), re, 1), j;
std::cout << *i++ << std::endl;
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