9
我有這些變量:如何使用Boost正則表達式替換方法?
boost::regex re //regular expression to use
std::string stringToChange //replace this string
std::string newValue //new value that is going to replace the stringToChange depending on the regex.
我只想只替換了它的第一次出現。
謝謝夥計們。
編輯:我發現這一點:
boost::regex_replace(stringToChange, re, boost::format_first_only);
,但它說,該函數不存在,我猜的參數是此刻不正確。
它不是一個有效的函數。 –