izua wrote:
Hmm.. I've checked out the documentation, and the examples are really, really way out of my league. Is there a wrapper function or something like this around it? Or anyone has one handy? I'll really appreciate it.
See if you can understand this one then: void find_all(const std::string& s, const boost::regex& e) { boost::sregex_iterator i(s.begin(), s.end(), e), j; while(i != j) { for(unsigned s = 0; s <= i->size(); ++s) { std::cout << "Location of sub-expression " << s << " match is " << i->position(s) << std::endl; std::cout << "Length of sub-expression " << s << " match is " << i->length(s) << std::endl; std::cout << "Text of sub-expression " << s << " match is \"" << i->str(s) << "\"" << std::endl; } ++i; } } John.