Boost logo

Boost Users :

Subject: [Boost-users] regex_replace for removing words
From: Kraus Philipp (philipp.kraus_at_[hidden])
Date: 2011-05-22 12:27:30


Hello,

I have some texts and I would like to remove words. Each word for
removing is in a std::vector<std::string> and I use a std::string for
separating the words on the text. My first idea is to use the
boost:split for splitting words of the text, in the result vector I
remove the words, which should be removed, and recreate the text from
the vector by concatination the elements. But another idea is to
create a regexpr with the removing word and the separators and use
regex_replace for removing.

Which idea is the better one or is there another way to removing word
of a text?

Thanks

PHil


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