Re: [Boost-users] replace_all_regex on c-string help

I got the string (char*s), which is too big (>10M), from an external library, it's too slow to convert the raw string to std::string before it is handled by replace_all_regex
Here's your fundamental problem: regex does not do in-place search and replace.
It is boost::algorithm::replace_all_regex, not boost:regex_replace

llwaeva@21cn.com wrote:
I got the string (char*s), which is too big (>10M), from an external library, it's too slow to convert the raw string to std::string before it is handled by replace_all_regex Here's your fundamental problem: regex does not do in-place search and replace. It is boost::algorithm::replace_all_regex, not boost:regex_replace
boost::replace_all_regex can do in-place search & replace, but for doing this, it requires that input is a sequnce that has basic manipulation operations like insert and erase. If you can provide these for char* I can tell you how to make it work with replace_*. Regards, Pavol

llwaeva@21cn.com wrote:
I got the string (char*s), which is too big (>10M), from an external library, it's too slow to convert the raw string to std::string before it is handled by replace_all_regex
Here's your fundamental problem: regex does not do in-place search and replace. It is boost::algorithm::replace_all_regex, not boost:regex_replace
It doesn't change the argument though. In place search and replace to a fixed size buffer is simply asking for trouble. John.
participants (3)
-
John Maddock
-
llwaeva@21cn.com
-
Pavol Droba