Angus Leeming <[EMAIL PROTECTED]> writes:

| Perfect. Shame boost isn't as clever as sed.

Actually it seems that boost is not far behind:

        string litex(".|*?+(){}[]^$\\");
        string fmt("\\\\$&");
        boost::RegEx reg("[]\\\\.|*?+(){}\\[^$]");
        string res = reg.Merge(litex, fmt);
        cout << "In: " << litex << "\nOut: " << res << endl;

It seems that only ']' and '\' need to be escaped.
(and the preprocessor help to make it look a bit ugly)

-- 
        Lgb

Reply via email to