Boost logo

Boost Users :

From: david v (danova_fr_at_[hidden])
Date: 2006-08-29 05:21:59


Hello,
I'm using the boost regex library to search short expressions in large
strings. The code below works fine but it almost does what ever i want. The
thing i'm missing and that i'm not sure to handle are the mismatches.
Basically when i look for a regex in a string i want to have the possibility
to get the number of mismatches and their respective positions. I read
through the docs and saw that the boost_check may do the work. Well the
think is that i'm not sure how to use it with my code and since the boost
library is quite complex it would be great if somebody could help to move
forward.

How can i use the code below to get the mismatches and their positions with
boost_check ???

#####Setting the regex
.....
re = "test";
boost::regex *regex = new boost::regex(re,boost::regbase::icase);
.....

#######Getting the matched
.......
std::string::const_iterator start = in.begin();
  std::string::const_iterator end = in.end();
  boost::smatch match;
  while (boost::regex_search(start,end,match,*regex,boost::match_extra))
      {
        cout << match.[0] << endl;
        start = match[0].second;
      }

#############Getting the mismatches ???
How ???

Any help would be extemely helpful !!!

david


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