0

I am using boost::regex to find a delimiter in a string (in c++) and replace it with a different one if exist:

const boost::regex esc(delimiter);
const std::string rep = "\\\\" + delimiter;

dest += boost::regex_replace(str, esc, rep,
            boost::match_default | boost::format_sed);

But when using boost::regex I have a huge decrease in performance (about 50%).

Does anyone know why? Is this a know issue?

Greg Bacon
  • 134,834
  • 32
  • 188
  • 245
Shay
  • 633
  • 2
  • 11
  • 27

1 Answers1

-1

We have, in recent times, rolled our own, state-machine based pattern matching routine, having figured out regex was slow. Does that help?

dirkgently
  • 108,024
  • 16
  • 131
  • 187