Boost logo

Boost Users :

From: John Maddock (john_maddock_at_[hidden])
Date: 2003-03-25 07:21:10


> static const boost::regex re1("jou");
> static const boost::regex re1("jau");
> static const boost::regex re1("nch");
> static const std::string fs1("sju");
> static const std::string fs2("sjo");
> static const std::string fs3("ngk");
>
> std::string res = regex_merge(
> regex_merge(
> regex_merge(input_string, re1, fs1)
> , re2, fs2)
> , re3, fs3);

Have you thought about combining these into one big regex:

static const boost::regex e("(jou)|(jau)|(nch)");
static const std::string format_string("(?1sju)(?2sjo)(?3ngk)"); //
conditional format string

regex_merge(input_string, e, format_string); // search and replace
everything at once

John.


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