Boost logo

Boost Users :

From: dave_at_[hidden]
Date: 2006-06-07 16:51:34


Hi, im having trouble with a base case for regex_search and the number of
hits it finds in a haystack. I am wondering if i am not setting flags
that need to be set, but i cannot find anything for this in the docs. My
usage only seems to find the string "HELLO" once, as the cout indicates
xcmMatch.size() is 1 after i run this. I am using boost libs 1.31.00 .
Thanks!

Heres my code:

    string sMatchMe = "HELLO";
    int theseflags=0;
    boost::regex xreMatchme(sMatchMe.c_str(), theseflags);
    boost::cmatch xcmMatch;
    string stupid = "sdfaHELLOdsfh*sadhfas1d3ahsdf%as&d!adfasdfsdHELLObnbc";
    if(regex_search(stupid.c_str(), xcmMatch, xreMatchme))
      {
        cout << "number of matches here should be " << xcmMatch.size() <<
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